From b8c35aea52f34a7baf689e96dd0361dd5c9f24cd Mon Sep 17 00:00:00 2001 From: Davide Angelocola Date: Fri, 26 Jun 2026 14:06:03 +0200 Subject: [PATCH] test(integration): skip fixture download on transient S3 5xx The Rust-interop tests download fixtures from S3. A transient 500 on a single object aborted the whole CI build (macos-25 cell) even though the fixture and decoder were fine. Inspect the HTTP response code and treat a 5xx as a skipped assumption instead of a hard error; a 4xx (fixture truly gone) still fails, since that is a real signal. Co-Authored-By: Claude Opus 4.8 --- .../integration/PcoFixtureInspectionIntegrationTest.java | 9 ++++++++- .../integration/RustWritesJavaReadsIntegrationTest.java | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/integration/src/test/java/io/github/dfa1/vortex/integration/PcoFixtureInspectionIntegrationTest.java b/integration/src/test/java/io/github/dfa1/vortex/integration/PcoFixtureInspectionIntegrationTest.java index d085081e..7eee4e21 100644 --- a/integration/src/test/java/io/github/dfa1/vortex/integration/PcoFixtureInspectionIntegrationTest.java +++ b/integration/src/test/java/io/github/dfa1/vortex/integration/PcoFixtureInspectionIntegrationTest.java @@ -12,6 +12,7 @@ import org.junit.jupiter.api.io.TempDir; import java.lang.foreign.MemorySegment; +import java.net.HttpURLConnection; import java.net.URI; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -314,7 +315,13 @@ private static Path downloadIfMissing(Path tmp, String name) throws Exception { return cached; } Path dest = tmp.resolve(name); - try (var in = URI.create(BASE + name).toURL().openStream()) { + var conn = (HttpURLConnection) URI.create(BASE + name).toURL().openConnection(); + int code = conn.getResponseCode(); + // S3 occasionally returns a transient 5xx; that is infrastructure noise, not + // an interop regression, so skip rather than redden the build. A 4xx (e.g. the + // fixture was removed/renamed) is a genuine signal and still fails. + assumeTrue(code < 500, () -> "transient S3 error " + code + " for " + name); + try (var in = conn.getInputStream()) { Files.copy(in, dest, StandardCopyOption.REPLACE_EXISTING); } return dest; diff --git a/integration/src/test/java/io/github/dfa1/vortex/integration/RustWritesJavaReadsIntegrationTest.java b/integration/src/test/java/io/github/dfa1/vortex/integration/RustWritesJavaReadsIntegrationTest.java index 41ff2591..a7a86d3b 100644 --- a/integration/src/test/java/io/github/dfa1/vortex/integration/RustWritesJavaReadsIntegrationTest.java +++ b/integration/src/test/java/io/github/dfa1/vortex/integration/RustWritesJavaReadsIntegrationTest.java @@ -38,6 +38,7 @@ import java.io.IOException; import java.lang.foreign.Arena; import java.lang.foreign.ValueLayout; +import java.net.HttpURLConnection; import java.net.URI; import java.nio.ByteOrder; import java.nio.file.Files; @@ -228,7 +229,13 @@ private static Path downloadIfMissing(Path tmp, String name) throws Exception { return cached; } Path dest = tmp.resolve(name); - try (var in = URI.create(S3_BASE + name).toURL().openStream()) { + var conn = (HttpURLConnection) URI.create(S3_BASE + name).toURL().openConnection(); + int code = conn.getResponseCode(); + // S3 occasionally returns a transient 5xx; that is infrastructure noise, not + // an interop regression, so skip rather than redden the build. A 4xx (e.g. the + // fixture was removed/renamed) is a genuine signal and still fails. + assumeTrue(code < 500, () -> "transient S3 error " + code + " for " + name); + try (var in = conn.getInputStream()) { Files.copy(in, dest, StandardCopyOption.REPLACE_EXISTING); } return dest;