Skip to content

Commit

Permalink
Merge branch 'main' into danielh/eng-785-run-mypy-on-servox
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Howell committed Feb 8, 2022
2 parents 44e51b6 + 3199e59 commit 7007dff
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"workbench.colorCustomizations": {
"_comment": "For ext stuart.unique-window-colors, can be removed",
"activityBar.background": "#24320E",
"titleBar.activeBackground": "#324613",
"titleBar.activeForeground": "#F7FBF1"
},
"python.analysis.diagnosticSeverityOverrides": {
"reportUnusedCoroutine": "information"
},
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"editor.rulers": [
120
]
}
9 changes: 5 additions & 4 deletions servo/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import httpx
import pydantic

import servo
import servo.errors
import servo.types
import servo.utilities
Expand Down Expand Up @@ -264,11 +265,10 @@ def set_if(d: Dict, k: str, v: Any):
def _is_fatal_status_code(error: Exception) -> bool:
if isinstance(error, httpx.HTTPStatusError):
if error.response.status_code < 500:
servo.logger.warning(
f"Giving up on non-retryable HTTP status code {error.response.status_code} ({error.response.reason_phrase}) for url: {error.request.url}"
servo.logger.error(
f"Giving up on non-retryable HTTP status code {error.response.status_code} ({error.response.reason_phrase}) "
)
return True

return False

@backoff.on_exception(
Expand Down Expand Up @@ -302,7 +302,8 @@ async def _post_event(self, event: Events, param) -> Union[CommandResponse, Stat

except httpx.HTTPError as error:
self.logger.error(
f'HTTP error "{error.__class__.__name__}" encountered while posting "{event}" event: {error}'
f'HTTP error "{error.__class__.__name__}" encountered while posting "{event}" event: {error}, for '
f"url {error.request.url} \n\n Response: {devtools.pformat(error.response.text)}"
)
self.logger.trace(_redacted_to_curl(error.request))
raise
Expand Down
2 changes: 1 addition & 1 deletion tests/connectors/kubernetes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ def kubetest_deployment_becomes_unready(
(
"if [ $(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) -gt 201326592 ]; "
"then /bin/fiber-http; "
"else (/bin/fiber-http &); sleep 10s; kill %1; "
"else (/bin/fiber-http &); sleep 10s; kill $(jobs -p '%/bin/fiber-http'); "
"fi"
),
]
Expand Down

0 comments on commit 7007dff

Please sign in to comment.