From f674b08a56469ebb77aba87cb99b6eeaeb697fc4 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 19 Nov 2026 00:04:57 +0900 Subject: [PATCH 1/2] =?UTF-8?q?test(objectstorage):=20MinIO=20=EC=8B=9C?= =?UTF-8?q?=ED=97=98=EC=9D=B4=20=EC=A4=80=EB=B9=84=20=ED=98=B8=EC=B6=9C?= =?UTF-8?q?=EC=9D=84=20=EC=8B=9C=ED=97=98=20=EB=8C=80=EC=83=81=EC=9D=98=20?= =?UTF-8?q?2=EC=B4=88=20=EC=8B=9C=ED=95=9C=EC=97=90=20=EA=B1=B8=EC=A7=80?= =?UTF-8?q?=20=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit main 단계 MinIO lane 두 개가 시험 전에, 준비 호출에서 실패한다. - run 304(6aac48a3, objectStorageMinioContractTest): MinioS3ManagedObjectProviderContractTest#initializationError. @BeforeAll의 createBucket이 "Acquire operation took longer than the configured maximum time"으로 끝났다. 시험 대상 client의 connection acquire 시한은 2초다. - run 310(99cc4f59, objectStorageMinioFaultTest): MinioManagedObjectFaultTest의 createBucket이 apiCallTimeout 2초를 넘어 ApiCallTimeoutException으로 끝났다. 끊김은 아직 걸지도 않았다. 두 시험 모두 JVM의 첫 S3 호출(SDK 초기화, 첫 연결, contract는 첫 TLS)을 시험 대상과 같은 짧은 시한의 client로 한다. 시험 JVM이 CPU를 못 받으면 그 첫 호출이 2초를 넘는다. MinIO 준비가 늦다는 가설은 버렸다. 첫 health 응답이 200이었고, 18회 모두 maximumAttempts 1인 첫 요청이 503 없이 성공했다. 고른 방법: 준비는 상태로 기다리고, 짧은 시한은 시험 대상 호출에만 건다. - contract: MinIO 준비를 TLS readiness probe로 기다리고, createBucket 전에 시험 대상 client로 listBuckets가 답할 때까지 기다린다(Awaitility, 60초). client의 2초 acquire 등 정책은 그대로 둔다. 계약 케이스는 데워진 client에서 시작한다. - 같은 lane의 MinioManagedObjectContractTest: readiness probe 대기만 더한다. - fault: 시험을 둘로 나눈다. 버킷과 객체는 MinIO로 바로 가는 준비용 client가 쓴다. 시험 대상 client는 proxy를 거친 읽기가 답할 때까지 기다린 뒤 끊는다. (1) 끊긴 호출은 SDK 자신의 시한 예외로 끝난다(원인 사슬에 ApiCallTimeoutException 또는 ApiCallAttemptTimeoutException, 멈춤은 30초 guard로 끊는다). 시험 client의 netty read·write 시한은 1초에서 10초로 올린다. call 예산(2초)보다 길어야 소켓 idle 시한이 SDK 시한과 경합하지 않고, 시험이 어느 시한이 끝냈는지 말할 수 있다. (2) 이은 뒤 읽기가 준비 PUT과 같은 contentLength·eTag를 돌려준다. 끊긴 동안의 읽기가 답하면 끊김이 없었던 것이라 given에서 실패한다. 회복은 결국 회복이다: 이은 직후 읽기는 실패할 수 있고, 대기 안에 한 번도 답하지 않을 때만 실패한다. "5초 안에 실패" 벽시계 단언은 지운다. CI 매뉴얼 8.4절대로 시한이 일어났는지를 단언하고 몇 초 안인지는 단언하지 않는다. 옛 이름의 "WithoutMutationReplay"는 옛 시험도 증명하지 않았다(PUT이 끊기 전에 끝났다). 그래서 버전 관리를 빼고 이름에서도 그 주장을 뺐다. 버린 대안: - 시험 client 시한을 늘린다: 시험 대상의 정책을 바꾸고, 더 느린 runner 에서 같은 실패가 다시 난다. - contract도 준비 client를 따로 둔다: contract는 production client factory가 만든 client를 시험하는 것이 목적이라 그 client를 데우는 편이 시험 대상에 맞다. - 재시도: 흔들림을 가린다(CI 매뉴얼 8.2절). 위험·한계: - contract 시험의 실패는 desktop에서 재현하지 못했다(기아 1코어 3회 통과, 첫 createBucket 최대 1.94초로 2초 바로 아래). 고침은 CI 실패 로그와 이 추세로 판단했다. - 준비 대기 상한은 60초다. MinIO가 끝내 답하지 않으면 2초가 아니라 60초 뒤 그 대기에서 실패한다. fault 시험 하나의 최악 시간은 약 150초다. 검증(desktop, 공유 잠금 아래). 「1코어 기아」는 Gradle과 시험 JVM을 taskset -c 0으로 한 코어에 묶고 같은 코어에 yes 12개를 띄운 것이다. 컨테이너는 묶지 않는다. - RED: 기준 99cc4f59 + 시간 탐침(출력만 더함), 1코어 기아 3회 → fault 3/3 실패(ApiCallTimeoutException 2000 millis, 첫 createBucket 3.2~3.8초), contract 3/3 통과. ~/be-main-red2-logs/b-starve1-base.log - GREEN(트리 1f75c24b: 기준 99ca4975 + 이 커밋. 이 커밋의 부모 cd523970과 99ca4975 사이는 장부·문서·검사 스크립트만 다르다): - 1코어 기아 3회: contract·fault 모두 3/3 통과. - spotlessCheck·compileIntegrationTestJava·testQualityCheck --no-build-cache rc=0. - objectStorageMinioContractTest --rerun 10/10(시험 19개씩), objectStorageMinioFaultTest --rerun 10/10(시험 2개씩), skip 0. - 변이: 시험 client의 apiCallAttemptTimeout·apiCallTimeout 두 줄을 지우면 fault 시험 2개가 모두 실패한다. ~/be-main-red2-logs/b5-verify.log --- .../MinioManagedObjectContractTest.java | 5 +- .../MinioManagedObjectFaultTest.java | 329 +++++++++++++----- ...ioS3ManagedObjectProviderContractTest.java | 20 +- 3 files changed, 256 insertions(+), 98 deletions(-) diff --git a/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/qualification/MinioManagedObjectContractTest.java b/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/qualification/MinioManagedObjectContractTest.java index 0860cba2..b53b477a 100644 --- a/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/qualification/MinioManagedObjectContractTest.java +++ b/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/qualification/MinioManagedObjectContractTest.java @@ -17,6 +17,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.wait.strategy.Wait; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.async.AsyncRequestBody; @@ -71,7 +72,9 @@ class MinioManagedObjectContractTest { .withEnv("MINIO_ROOT_USER", accessKey) .withEnv("MINIO_ROOT_PASSWORD", secretKey) .withEnv("MINIO_KMS_SECRET_KEY", kmsKey) - .withCommand("server", "/data"); + .withCommand("server", "/data") + // Ready is MinIO answering its readiness probe, not its port accepting a connection. + .waitingFor(Wait.forHttp("/minio/health/ready").forPort(9000)); minio.start(); client = S3AsyncClient.builder() diff --git a/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/qualification/MinioManagedObjectFaultTest.java b/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/qualification/MinioManagedObjectFaultTest.java index 3854de1a..68884e86 100644 --- a/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/qualification/MinioManagedObjectFaultTest.java +++ b/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/qualification/MinioManagedObjectFaultTest.java @@ -1,140 +1,277 @@ package dev.caskeleton.adapter.outbound.objectstorage.qualification; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.assertj.core.api.Assertions.catchThrowable; +import static org.awaitility.Awaitility.await; import eu.rekawek.toxiproxy.Proxy; import eu.rekawek.toxiproxy.ToxiproxyClient; +import eu.rekawek.toxiproxy.model.Toxic; import eu.rekawek.toxiproxy.model.ToxicDirection; import java.net.URI; import java.nio.ByteBuffer; import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; import java.util.UUID; -import java.util.concurrent.CompletionException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.Network; +import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.toxiproxy.ToxiproxyContainer; -import org.testcontainers.utility.DockerImageName; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.async.AsyncRequestBody; import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; +import software.amazon.awssdk.core.exception.ApiCallAttemptTimeoutException; +import software.amazon.awssdk.core.exception.ApiCallTimeoutException; import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.S3AsyncClient; import software.amazon.awssdk.services.s3.model.CreateBucketRequest; import software.amazon.awssdk.services.s3.model.HeadObjectRequest; +import software.amazon.awssdk.services.s3.model.HeadObjectResponse; import software.amazon.awssdk.services.s3.model.PutObjectRequest; +/** + * A client with a one-second attempt and two-second call budget, behind a Toxiproxy whose + * connection the test cuts: the cut ends in the client's own timeout, and once it heals a read + * finds the object the setup wrote. + * + *

Only what is under test runs on that client and through the proxy. The bucket and the object + * are written beforehand by a second client straight to MinIO, without the tight budget: on a + * loaded main-stage runner those setup calls, the first S3 requests of the JVM, overran two seconds + * and failed the lane before the cut was ever made (main run of 99cc4f59, 2026-11-13). The client + * under test then shows it reaches MinIO through the proxy before the cut by waiting for that state + * rather than for a fixed time, and the recovery is the same wait: healed means a read through the + * proxy answers again, however long the runner takes to get there. Recovery is eventual: a read + * right after the heal may still fail on a connection the cut left behind, and only a read that + * never answers within the wait fails the test. + */ class MinioManagedObjectFaultTest { private static final int TOXIPROXY_CONTROL_PORT = 8474; private static final int TOXIPROXY_PROXY_PORT = 8666; private static final String CUT_CONNECTION_DOWNSTREAM = "CUT_CONNECTION_DOWNSTREAM"; private static final String CUT_CONNECTION_UPSTREAM = "CUT_CONNECTION_UPSTREAM"; + private static final String BUCKET = "object-storage-fault"; + private static final String KEY = "fault/exact"; + private static final byte[] BODY = {1, 2, 3}; + // Bounds a hang, not a latency. The client's own call budget is two seconds; a call still open + // after this long was not ended by that budget at all. + private static final Duration HANG_GUARD = Duration.ofSeconds(30); + private static final Duration STATE_WAIT = Duration.ofSeconds(60); - // Every container below is declared in try-with-resources; the fluent `withX` chain returns the - // same instance, which the compiler reads as a second, unclosed resource. + private static Network network; + private static GenericContainer minio; + private static ToxiproxyContainer toxiproxy; + private static Proxy proxy; + private static String accessKey; + private static String secretKey; + private static String writtenETag; + + @BeforeAll + // The containers are assigned to static fields and stopped in the matching @AfterAll; the fluent + // withX chain reads to the compiler as a second, unclosed instance. @SuppressWarnings("resource") - @Test - void connectionCutProducesABoundedFailureAndRecoveryWithoutMutationReplay() throws Exception { - DockerImageName minioImage = QualificationImages.minio(); - DockerImageName toxiproxyImage = QualificationImages.toxiproxy(); - String accessKey = "a" + UUID.randomUUID().toString().replace("-", ""); - String secretKey = UUID.randomUUID().toString().replace("-", "") + UUID.randomUUID(); - try (Network network = Network.newNetwork(); - GenericContainer minio = - new GenericContainer<>(minioImage) - .withNetwork(network) - .withNetworkAliases("qualified-minio") - .withExposedPorts(9000) - .withEnv("MINIO_ROOT_USER", accessKey) - .withEnv("MINIO_ROOT_PASSWORD", secretKey) - .withCommand("server", "/data"); - ToxiproxyContainer toxiproxy = - new ToxiproxyContainer(toxiproxyImage) - .withNetwork(network) - .withExposedPorts(TOXIPROXY_CONTROL_PORT, TOXIPROXY_PROXY_PORT)) { - minio.start(); - toxiproxy.start(); - ToxiproxyClient toxiproxyClient = - new ToxiproxyClient(toxiproxy.getHost(), toxiproxy.getControlPort()); - Proxy proxy = - toxiproxyClient.createProxy( - "qualified-minio", "0.0.0.0:" + TOXIPROXY_PROXY_PORT, "qualified-minio:9000"); - try (S3AsyncClient client = - S3AsyncClient.builder() - .endpointOverride( - URI.create( - "http://" - + toxiproxy.getHost() - + ":" - + toxiproxy.getMappedPort(TOXIPROXY_PROXY_PORT))) - .region(Region.US_EAST_1) - .credentialsProvider( - StaticCredentialsProvider.create( - AwsBasicCredentials.create(accessKey, secretKey))) - .httpClient( - NettyNioAsyncHttpClient.builder() - .connectionTimeout(Duration.ofMillis(500)) - .readTimeout(Duration.ofSeconds(1)) - .writeTimeout(Duration.ofSeconds(1)) - .maxConcurrency(2) - .maxPendingConnectionAcquires(2) - .build()) - .overrideConfiguration( - ClientOverrideConfiguration.builder() - .apiCallAttemptTimeout(Duration.ofSeconds(1)) - .apiCallTimeout(Duration.ofSeconds(2)) - .build()) - .forcePathStyle(true) - .multipartEnabled(false) - .build()) { - String bucket = "object-storage-fault"; - client.createBucket(CreateBucketRequest.builder().bucket(bucket).build()).join(); - byte[] body = {1, 2, 3}; - client - .putObject( - PutObjectRequest.builder() - .bucket(bucket) - .key("fault/exact") - .ifNoneMatch("*") - .contentLength((long) body.length) - .build(), - AsyncRequestBody.fromByteBuffer(ByteBuffer.wrap(body))) - .join(); - - setConnectionCut(proxy, true); - long started = System.nanoTime(); - assertThatThrownBy( - () -> - client - .headObject( - HeadObjectRequest.builder().bucket(bucket).key("fault/exact").build()) - .join()) - .isInstanceOf(CompletionException.class); - assertThat(Duration.ofNanos(System.nanoTime() - started)).isLessThan(Duration.ofSeconds(5)); - - setConnectionCut(proxy, false); - assertThat( - client - .headObject( - HeadObjectRequest.builder().bucket(bucket).key("fault/exact").build()) - .join() - .contentLength()) - .isEqualTo(body.length); - } + static void startMinioBehindToxiproxy() throws Exception { + accessKey = "a" + UUID.randomUUID().toString().replace("-", ""); + secretKey = UUID.randomUUID().toString().replace("-", "") + UUID.randomUUID(); + network = Network.newNetwork(); + minio = + new GenericContainer<>(QualificationImages.minio()) + .withNetwork(network) + .withNetworkAliases("qualified-minio") + .withExposedPorts(9000) + .withEnv("MINIO_ROOT_USER", accessKey) + .withEnv("MINIO_ROOT_PASSWORD", secretKey) + .withCommand("server", "/data") + // Ready is MinIO answering its readiness probe, not its port accepting a connection. + .waitingFor(Wait.forHttp("/minio/health/ready").forPort(9000)); + toxiproxy = + new ToxiproxyContainer(QualificationImages.toxiproxy()) + .withNetwork(network) + .withExposedPorts(TOXIPROXY_CONTROL_PORT, TOXIPROXY_PROXY_PORT); + minio.start(); + toxiproxy.start(); + proxy = + new ToxiproxyClient(toxiproxy.getHost(), toxiproxy.getControlPort()) + .createProxy( + "qualified-minio", "0.0.0.0:" + TOXIPROXY_PROXY_PORT, "qualified-minio:9000"); + try (S3AsyncClient setup = setupClient()) { + setup.createBucket(CreateBucketRequest.builder().bucket(BUCKET).build()).join(); + writtenETag = + setup + .putObject( + PutObjectRequest.builder() + .bucket(BUCKET) + .key(KEY) + .ifNoneMatch("*") + .contentLength((long) BODY.length) + .build(), + AsyncRequestBody.fromByteBuffer(ByteBuffer.wrap(BODY))) + .join() + .eTag(); } } - private static void setConnectionCut(Proxy proxy, boolean shouldCutConnection) throws Exception { + @AfterAll + static void stopMinioBehindToxiproxy() { + if (toxiproxy != null) { + toxiproxy.stop(); + } + if (minio != null) { + minio.stop(); + } + if (network != null) { + network.close(); + } + } + + @AfterEach + void healTheConnection() throws Exception { + setConnectionCut(false); + } + + @Test + void aCutConnectionEndsInTheClientsOwnTimeoutRatherThanAHang() throws Exception { + // given + try (S3AsyncClient client = impatientClientThroughProxy()) { + awaitReadThroughProxy(client); + setConnectionCut(true); + + // when + Throwable failure = + catchThrowable(() -> head(client).get(HANG_GUARD.toSeconds(), TimeUnit.SECONDS)); + + // then + // The SDK ends the call with its call timeout, or wraps the last attempt's timeout in an + // SdkClientException once the attempts are spent; either way one of its own timeouts is in + // the chain (seen both ways under a starved CPU, 2026-11-18). + assertThat(causalChain(failure)) + .anySatisfy( + cause -> + assertThat(cause) + .isInstanceOfAny( + ApiCallTimeoutException.class, ApiCallAttemptTimeoutException.class)); + } + } + + @Test + void aReadAfterTheCutHealsFindsTheObjectTheSetupWrote() throws Exception { + // given + try (S3AsyncClient client = impatientClientThroughProxy()) { + awaitReadThroughProxy(client); + setConnectionCut(true); + // A read made while the connection is cut. It must fail, or there was no cut to heal from; + // the other test asserts how it ends. + HeadObjectResponse duringCut = + head(client) + .handle((response, failure) -> response) + .get(HANG_GUARD.toSeconds(), TimeUnit.SECONDS); + if (duringCut != null) { + throw new IllegalStateException("a read through the cut proxy still answered"); + } + setConnectionCut(false); + + // when + HeadObjectResponse recovered = + await() + .atMost(STATE_WAIT) + .ignoreExceptions() + .until( + () -> head(client).get(HANG_GUARD.toSeconds(), TimeUnit.SECONDS), + Objects::nonNull); + + // then + assertThat(recovered) + .extracting(HeadObjectResponse::contentLength, HeadObjectResponse::eTag) + .containsExactly((long) BODY.length, writtenETag); + } + } + + private static List causalChain(Throwable failure) { + List chain = new ArrayList<>(); + for (Throwable cause = failure; + cause != null && !chain.contains(cause); + cause = cause.getCause()) { + chain.add(cause); + } + return chain; + } + + private static CompletableFuture head(S3AsyncClient client) { + return client.headObject(HeadObjectRequest.builder().bucket(BUCKET).key(KEY).build()); + } + + // The client under test reaches MinIO through the proxy before the cut: the cut is then made on + // a path that worked, and the JVM's first S3 call is behind it rather than inside the budget. + private static void awaitReadThroughProxy(S3AsyncClient client) { + await() + .atMost(STATE_WAIT) + .ignoreExceptions() + .until(() -> head(client).get(HANG_GUARD.toSeconds(), TimeUnit.SECONDS), Objects::nonNull); + } + + private static S3AsyncClient impatientClientThroughProxy() { + return S3AsyncClient.builder() + .endpointOverride( + URI.create( + "http://" + + toxiproxy.getHost() + + ":" + + toxiproxy.getMappedPort(TOXIPROXY_PROXY_PORT))) + .region(Region.US_EAST_1) + .credentialsProvider( + StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey))) + .httpClient( + NettyNioAsyncHttpClient.builder() + .connectionTimeout(Duration.ofMillis(500)) + // Longer than the call budget, so the SDK's own budgets end a cut call rather than + // a socket idle timeout racing them; the first test can then say which ended it. + .readTimeout(Duration.ofSeconds(10)) + .writeTimeout(Duration.ofSeconds(10)) + .maxConcurrency(2) + .maxPendingConnectionAcquires(2) + .build()) + .overrideConfiguration( + ClientOverrideConfiguration.builder() + .apiCallAttemptTimeout(Duration.ofSeconds(1)) + .apiCallTimeout(Duration.ofSeconds(2)) + .build()) + .forcePathStyle(true) + .multipartEnabled(false) + .build(); + } + + // Straight to MinIO, with the SDK's connection defaults. The call budget only bounds a hang. + private static S3AsyncClient setupClient() { + return S3AsyncClient.builder() + .endpointOverride(URI.create("http://" + minio.getHost() + ":" + minio.getMappedPort(9000))) + .region(Region.US_EAST_1) + .credentialsProvider( + StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey))) + .overrideConfiguration( + ClientOverrideConfiguration.builder().apiCallTimeout(STATE_WAIT).build()) + .forcePathStyle(true) + .multipartEnabled(false) + .build(); + } + + private static void setConnectionCut(boolean shouldCutConnection) throws Exception { if (shouldCutConnection) { proxy.toxics().bandwidth(CUT_CONNECTION_DOWNSTREAM, ToxicDirection.DOWNSTREAM, 0); proxy.toxics().bandwidth(CUT_CONNECTION_UPSTREAM, ToxicDirection.UPSTREAM, 0); return; } - proxy.toxics().get(CUT_CONNECTION_DOWNSTREAM).remove(); - proxy.toxics().get(CUT_CONNECTION_UPSTREAM).remove(); + for (Toxic toxic : proxy.toxics().getAll()) { + toxic.remove(); + } } } diff --git a/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/MinioS3ManagedObjectProviderContractTest.java b/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/MinioS3ManagedObjectProviderContractTest.java index c1547434..56af3c39 100644 --- a/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/MinioS3ManagedObjectProviderContractTest.java +++ b/src/adapter/outbound/objectstorage/src/integrationTest/java/dev/caskeleton/adapter/outbound/objectstorage/s3/MinioS3ManagedObjectProviderContractTest.java @@ -1,5 +1,7 @@ package dev.caskeleton.adapter.outbound.objectstorage.s3; +import static org.awaitility.Awaitility.await; + import dev.caskeleton.adapter.outbound.objectstorage.contract.ObjectStorageProviderContract; import dev.caskeleton.adapter.outbound.objectstorage.provider.ObjectStorageProvider; import dev.caskeleton.adapter.outbound.objectstorage.qualification.QualificationImages; @@ -10,13 +12,16 @@ import java.security.SecureRandom; import java.time.Clock; import java.time.Duration; import java.util.Base64; +import java.util.Objects; import java.util.UUID; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.testcontainers.DockerClientFactory; import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.MountableFile; import software.amazon.awssdk.services.s3.S3AsyncClient; import software.amazon.awssdk.services.s3.model.BucketVersioningStatus; @@ -73,7 +78,11 @@ class MinioS3ManagedObjectProviderContractTest extends ObjectStorageProviderCont .withEnv( "MINIO_KMS_SECRET_KEY", "contract-key:" + Base64.getEncoder().encodeToString(keyBytes)) - .withCommand("server", "/data", "--certs-dir", "/certs"); + .withCommand("server", "/data", "--certs-dir", "/certs") + // Ready is MinIO answering its readiness probe over the TLS it serves, not its port + // accepting a connection. The probe trusts any certificate: it only asks whether the + // server is up, and the client below is the one that checks the certificate. + .waitingFor(Wait.forHttps("/minio/health/ready").forPort(9000).allowInsecure()); minio.start(); // The production client factory, so the provider runs on the client it ships with (checksum // calculation WHEN_REQUIRED, no SDK multipart, bounded Netty pool). @@ -113,6 +122,15 @@ class MinioS3ManagedObjectProviderContractTest extends ObjectStorageProviderCont S3ProviderBindingTest.pgstySettings( ObjectStorageProvider.Capability.IMMUTABLE_CREATE)), Clock.systemUTC()); + // The first request of the JVM pays for the first TLS connection, the SDK's class loading and + // its signer, and on a loaded main-stage runner that took longer than the two-second + // connection acquire budget above: the lane failed here, in setup, before any contract case + // ran (main run of 6aac48a3, 2026-11-13). The budget is the client under test's and stays; the + // setup waits until a read on that client answers, so the cases start on a warm client. + await() + .atMost(Duration.ofSeconds(60)) + .ignoreExceptions() + .until(() -> client.listBuckets().get(30, TimeUnit.SECONDS), Objects::nonNull); client.createBucket(CreateBucketRequest.builder().bucket(binding.bucket()).build()).join(); client .putBucketVersioning( -- 2.54.0 From ca0735965309c2195d44f813ad720780448cfa9e Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 19 Nov 2026 00:04:57 +0900 Subject: [PATCH 2/2] =?UTF-8?q?docs(ledger):=20MinIO=20=EC=A4=80=EB=B9=84?= =?UTF-8?q?=20=ED=98=B8=EC=B6=9C=20=EC=8B=9C=ED=95=9C=20=ED=9D=94=EB=93=A4?= =?UTF-8?q?=EB=A6=BC=20=EB=91=90=20=EA=B1=B4=EC=9D=84=20=EC=9E=A5=EB=B6=80?= =?UTF-8?q?=EC=97=90=20=EB=82=A8=EA=B8=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: main run 304·310에서 흔들린 MinIO 시험 두 건(범주 fixed-time)이 흔들림 장부에 없다. CI 매뉴얼 8.5절은 흔들림 하나마다 한 줄을 남기게 한다. 방법: 판정(desktop 1코어 기아 결과)과 첫 run 번호로 두 줄을 더한다. fixed_by는 장부 README대로 고친 PR이 병합된 뒤 채운다. 검증: 노트북 `python3 -m unittest scripts/tests/test_ledger.py` rc=0, `python3 scripts/check-docs.py`·`check-work-docs.py` rc=0. --- docs/ledger/flaky-tests.jsonl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/ledger/flaky-tests.jsonl b/docs/ledger/flaky-tests.jsonl index fd43a389..b86fc18a 100644 --- a/docs/ledger/flaky-tests.jsonl +++ b/docs/ledger/flaky-tests.jsonl @@ -3,3 +3,5 @@ {"date": "2026-11-13", "test": "FailureInjectionContractTest#aSlowDripThroughToxiproxyEndsAtTheTotalDeadline[JDK]", "category": "fixed-time", "first_run": "228", "verdict": "runner 1회 실패(1.92초, 상한 1.5초). desktop 부하 6.5~8에서 10회 통과(호출 1,010~1,021ms)", "quarantined_until": "", "fixed_by": "백엔드 #34"} {"date": "2026-11-13", "test": "LiveEventLogContractTest#concurrentWritersAllocateDistinctPositions", "category": "concurrency-order", "first_run": "260", "verdict": "replay 순서를 writer 제출 순서로 단언했다. 둘째 writer를 먼저 돌린 탐침에서 재현. 고침 PR 백엔드 #39(열림)", "quarantined_until": "", "fixed_by": ""} {"date": "2026-11-13", "test": "JettyAttemptDeadlineTest#aSlowDripExchangeIsAbortedAtTheAttemptDeadline", "category": "fixed-time", "first_run": "desktop ~/w2-reloc-logs/w2-reloc-a.log (main c7a18ec7, prCheck, 시작 부하 11~15)", "verdict": "desktop 1회 실패(1.68초, 상한 1.5초). PR 단계 test라 runner PR run에서도 날 수 있다", "quarantined_until": "", "fixed_by": ""} +{"date": "2026-11-13", "test": "MinioS3ManagedObjectProviderContractTest#initializationError", "category": "fixed-time", "first_run": "304", "verdict": "재현 안 됨(desktop 1코어 기아 3회 통과, 첫 createBucket 최대 1.94초/acquire 2초)", "quarantined_until": "", "fixed_by": ""} +{"date": "2026-11-13", "test": "MinioManagedObjectFaultTest#connectionCutProducesABoundedFailureAndRecoveryWithoutMutationReplay", "category": "fixed-time", "first_run": "310", "verdict": "desktop 1코어 기아 3회 중 3회 실패(첫 createBucket 3.2~3.8초/apiCallTimeout 2초)", "quarantined_until": "", "fixed_by": ""} -- 2.54.0