FrankYang0529 commented on code in PR #75829:
URL: https://github.com/apache/airflow/pull/75829#discussion_r4396704640


##########
scripts/tests/ci/test_spot_interruptions.py:
##########
@@ -329,6 +334,7 @@ def test_run_pr_comments_when_listing_the_runs_fails(spot, 
error, expected_ok):
     [
         pytest.param(("repos/x",), [SERVER_ERROR, SERVER_ERROR], 3, None, 
id="retries-server-errors"),
         pytest.param(("repos/x",), [SERVER_ERROR] * 3, 3, SERVER_ERROR, 
id="gives-up"),
+        pytest.param(("repos/x",), [STREAM_ERROR], 2, None, 
id="retries-dropped-connections"),

Review Comment:
   It looks like only `stream error` is covered here. How about adding a test 
for `is_transient` like:
   
   ```py
   @pytest.mark.parametrize(
       ("stderr", "expected"),
       [
           pytest.param("gh: Server Error (HTTP 502)\n", True, 
id="server-error"),
           pytest.param("stream error: stream ID 3; CANCEL; received from 
peer\n", True, id="stream-reset"),
           pytest.param('Get "https://api.github.com/repos/x": read tcp …: 
read: connection reset by peer\n', True, id="connection-reset"),
           pytest.param('Get "https://api.github.com/repos/x": unexpected 
EOF\n', True, id="unexpected-eof"),
           pytest.param('Get "https://api.github.com/repos/x": net/http: TLS 
handshake timeout\n', True, id="tls-timeout"),
           pytest.param('Get "https://api.github.com/repos/x": dial tcp 
140.82.112.6:443: i/o timeout\n', True, id="dial-timeout"),
           pytest.param("gh: Not Found (HTTP 404)\n", False, id="client-error"),
       ],
   )
   def test_is_transient(spot, stderr, expected):
       assert spot.is_transient(subprocess.CalledProcessError(1, ["gh"], 
stderr=stderr)) is expected
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to