Skip to content

Commit 879a50d

Browse files
author
Cairn Build
committed
test(replication-chaos): treat the BotoCoreError family as transient, not fatal
The S2 SIGKILL scenario flaked: get_body() only caught (ClientError, EndpointConnectionError), but a server that is down / being SIGKILLed / mid-restart also raises other BotoCoreError subclasses (ResponseStreamingError, ConnectionError, ReadTimeoutError) — boto3 has retries.max_attempts=1, so a single transient stream hiccup during the convergence poll propagated as an unhandled exception and failed the run. Catch the BotoCoreError base instead; converged() still counts real convergence, so this makes the poll resilient without masking an actual failure. Not a regression from the build-once CI change (it passed on the prior commit with the same binary); a pre-existing timing flake.
1 parent ab6cf2d commit 879a50d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

conformance/replication_chaos.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import os, signal, subprocess, sys, time
1919
import boto3
2020
from botocore.config import Config
21-
from botocore.exceptions import ClientError, EndpointConnectionError
21+
from botocore.exceptions import BotoCoreError, ClientError
2222

2323
BIN = os.environ.get("BIN", "target/debug/cairn")
2424
ROOT = os.environ["DATA"]
@@ -115,7 +115,13 @@ def setup_replication(src):
115115
def get_body(cl, key):
116116
try:
117117
return cl.get_object(Bucket=BUCKET, Key=key)["Body"].read()
118-
except (ClientError, EndpointConnectionError):
118+
except ClientError:
119+
return None
120+
except BotoCoreError:
121+
# A server that is down, being SIGKILLed, or mid-restart raises the BotoCoreError family
122+
# (ConnectionError, ResponseStreamingError, ReadTimeoutError, EndpointConnectionError). In a
123+
# fault-injection test that is expected: treat it as "not available yet" so the convergence
124+
# poll keeps trying instead of crashing the run.
119125
return None
120126

121127
def converged(tgt, expected, timeout=90):

0 commit comments

Comments
 (0)