refactor(test): narrow Lambda dispatch probe to transport-level exceptions (#395)

* refactor: narrow exception handling to transport-level failures only

The broad catch(Exception) in the Lambda dispatch probe and warmup
swallowed all errors, masking real service regressions as skipped tests.
Narrow to specific transport-level exceptions so only environment
unavailability (timeout, connection refused) triggers a skip:

- Java probe: SdkClientException + ConnectException (not all Exception)
- APIGW warmup: HttpTimeoutException + ConnectException
- Go invoke: net.Error via errors.As (not any error)

Unexpected service errors now propagate as test failures.

* fix: remove unreachable ConnectException catch in lambda probe

AWS SDK wraps all transport-level failures (ConnectException,
ApiCallTimeoutException, etc.) in SdkClientException, so the
separate ConnectException catch was unreachable and broke compilation.

* fix(compat): use unique_name in s3-notifications.bats to avoid parallel collisions

Parallel bats workers could share the same $(date +%s) timestamp,
producing identical bucket/queue/topic names. One worker's
put-bucket-notification-configuration would overwrite another's,
and the round-trip read would return zero filter rules. Switch to
unique_name which appends the shell PID.

* fix(compat): use unique_name in kms and ses bats to avoid parallel collisions

Same class of flake as s3-notifications.bats. Under --jobs 4, parallel
bats workers sharing a $(date +%s) timestamp produce identical alias
names (kms) and identity names (ses), causing cross-worker interference.
This commit is contained in:
TiM authored and GitHub committed 2026-04-13 21:49:26 -05:00
1 parent 467f5e0f79
commit 38eb0125a9
6 files changed
+27 -16

No files matched your search

@@ -55,6 +55,8 @@ import java.util.UUID;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import software.amazon.awssdk.core.exception.SdkClientException;
/**
* Shared test utilities and AWS client factories.
*/
@@ -126,9 +128,9 @@ public final class TestFixtures {
* Thread-safe: uses double-checked locking so parallel test classes don't
* race the probe.
*
* Returns false on any transport-level failure (timeout, connection refused,
* SDK timeout) so that tests can skip cleanly when Docker-in-Docker is
* unavailable in CI.
* Returns false on transport-level failures (timeout, connection refused,
* SDK client timeout) so tests skip cleanly when Docker-in-Docker is
* unavailable in CI. Unexpected service errors propagate as test failures.
*/
public static boolean isLambdaDispatchAvailable() {
if (lambdaDispatchAvailable != null) {
@@ -157,7 +159,9 @@ public final class TestFixtures {
.overrideConfiguration(c -> c.apiCallTimeout(Duration.ofSeconds(30)))
.build());
lambdaDispatchAvailable = response.statusCode() == 200;
} catch (Exception e) {
} catch (SdkClientException e) {
// SDK-level timeout or connection failure (wraps ConnectException,
// ApiCallTimeoutException, etc.)
lambdaDispatchAvailable = false;
} finally {
try {