Skip to content

Commit

Permalink
Give docs job write permissions. (#360)
Browse files Browse the repository at this point in the history
* Our Github workflows don't have write permissions by default anymore, so be explicit.
* make test more resiliant to internet flakiness
  • Loading branch information
graebm authored Jun 2, 2022
1 parent 62ac980 commit 4a454a9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
jobs:
update-docs-branch:
runs-on: ubuntu-20.04 # latest
permissions:
contents: write # allow push
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
16 changes: 13 additions & 3 deletions test/appexit_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ def set_stage(stage):
set_stage(Stage.HttpClientStart)

# HttpClientConnected
http_connection = http_connection.result(TIMEOUT)
try:
http_connection = http_connection.result(TIMEOUT)
except Exception:
# the internet's a flaky place and this isn't a correctness test
print("Connection failed. Exiting out early...")
set_stage(Stage.Done)

set_stage(Stage.HttpClientConnected)

# HttpStreamStart
Expand All @@ -102,8 +108,12 @@ def on_incoming_body(http_stream, chunk):
set_stage(Stage.HttpStreamReceivingBody)

# HttpStreamDone
status_code = http_stream.completion_future.result(TIMEOUT)
assert(status_code == 200)
try:
status_code = http_stream.completion_future.result(TIMEOUT)
except Exception:
# the internet's a flaky place and this isn't a correctness test
print("Request failed. Continuing with cleanup...")

del http_stream
del request
set_stage(Stage.HttpStreamDone)
Expand Down

0 comments on commit 4a454a9

Please sign in to comment.