Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Loading