Merge origin/main (e7be517e, #13 NegotiatedProtocol flake 고침 등) into PR #12 브랜치
pr / done (pull_request) Successful in 12m51s

This commit is contained in:
donghyeon-ka
2026-11-12 18:44:55 +09:00
30 changed files with 500 additions and 167 deletions
@@ -41,6 +41,10 @@ public final class HttpResponseLossFixture implements ResponseLossFixture {
private void reset() {
try {
HttpURLConnection connection = open(FaultFixtureProtocol.SIDE_EFFECTS_PATH, "DELETE");
// The generous timeout, like the retry and the side-effect count. The armed one (750 ms) is
// for the call whose reply the container drops; on a loaded runner an ordinary reset reply
// took longer than that, and the scenario failed before it began (main run 24, 2026-11-08).
connection.setReadTimeout(HttpFixtureTimeouts.READ_MILLIS);
connection.getResponseCode();
connection.disconnect();
} catch (IOException e) {
@@ -8,6 +8,7 @@ import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpConfigurationExc
import dev.caskeleton.adapter.outbound.httpclient.jdk.JdkClientFactory;
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile;
import dev.caskeleton.adapter.outbound.httpclient.profile.HttpProtocol;
import dev.caskeleton.adapter.outbound.httpclient.profile.TimeoutSettings;
import dev.caskeleton.adapter.outbound.httpclient.profile.TransportType;
import dev.caskeleton.adapter.outbound.httpclient.testkit.ClientProfiles;
import dev.caskeleton.adapter.outbound.httpclient.testkit.MockHttpServer;
@@ -17,6 +18,7 @@ import dev.caskeleton.adapter.outbound.httpclient.transport.TransportCapabilityV
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.util.Optional;
import java.util.Set;
import org.junit.jupiter.api.Tag;
@@ -36,6 +38,19 @@ import org.junit.jupiter.api.Test;
@Tag("httpclient-contract")
class NegotiatedProtocolContractTest {
// What these tests measure is the protocol, not a budget. The shared fixture profile allows
// 500 ms to connect and 1 s for the handshake, which a loaded CI runner missed (connect timeout,
// main push 2026-11-11; the desktop too under load 18-24 on 2026-11-08). The DNS budget stays
// the shipped default, the only value the platform accepts for it.
private static final TimeoutSettings OUT_OF_THE_WAY =
new TimeoutSettings(
TimeoutSettings.DEFAULT_DNS,
Duration.ofSeconds(10),
Duration.ofSeconds(10),
Duration.ofSeconds(10),
Duration.ofSeconds(10),
Duration.ofSeconds(30));
@Test
void theJdkTransportNegotiatesHttp2WhenTheProfileAsksForIt() throws Exception {
TlsFixture fixture = TlsFixture.trusted();
@@ -44,6 +59,7 @@ class NegotiatedProtocolContractTest {
ClientProfile profile =
ClientProfiles.builder("h2")
.baseUrl(server.uri("/"))
.timeout(OUT_OF_THE_WAY)
.transport(TransportType.JDK)
.protocols(Set.of(HttpProtocol.HTTP_2, HttpProtocol.HTTP_1_1))
.build();
@@ -70,6 +86,7 @@ class NegotiatedProtocolContractTest {
ClientProfile profile =
ClientProfiles.builder("h1")
.baseUrl(server.uri("/"))
.timeout(OUT_OF_THE_WAY)
.transport(TransportType.JDK)
.protocols(Set.of(HttpProtocol.HTTP_1_1))
.build();
@@ -15,6 +15,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.DockerClientFactory;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.utility.MountableFile;
import software.amazon.awssdk.services.s3.S3AsyncClient;
@@ -53,7 +54,11 @@ class MinioS3ManagedObjectProviderContractTest extends ObjectStorageProviderCont
String secretKey = UUID.randomUUID().toString().replace("-", "") + UUID.randomUUID();
byte[] keyBytes = new byte[32];
SECURE_RANDOM.nextBytes(keyBytes);
Path certificates = SelfSignedServerCertificate.writeTo(Files.createTempDirectory("minio-tls"));
// The host the mapped port is published on: localhost on a workstation, the Docker daemon's
// address inside a CI job container. The certificate has to name it.
String containerHost = DockerClientFactory.instance().dockerHostIpAddress();
Path certificates =
SelfSignedServerCertificate.writeTo(Files.createTempDirectory("minio-tls"), containerHost);
trustStoreBefore = SelfSignedServerCertificate.trustForThisJvm(certificates);
minio =
new GenericContainer<>(QualificationImages.minio())
@@ -90,7 +95,12 @@ class MinioS3ManagedObjectProviderContractTest extends ObjectStorageProviderCont
.retryBaseDelay(Duration.ofMillis(10))
.retryMaximumBackoff(Duration.ofMillis(20))
.shutdownGrace(Duration.ofSeconds(2))
.endpointOverride(URI.create("https://localhost:" + minio.getMappedPort(9000)))
.endpointOverride(
URI.create(
"https://"
+ endpointHost(containerHost)
+ ":"
+ minio.getMappedPort(9000)))
.pathStyleAccess(true)
.staticCredentials(accessKey, secretKey)
.build());
@@ -138,4 +148,9 @@ class MinioS3ManagedObjectProviderContractTest extends ObjectStorageProviderCont
protected ObjectStorageProvider provider() {
return provider;
}
// An IPv6 literal needs brackets in a URI authority.
private static String endpointHost(String containerHost) {
return containerHost.contains(":") ? "[" + containerHost + "]" : containerHost;
}
}
@@ -11,10 +11,14 @@ import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* A throwaway localhost server certificate for one lane run, made with the running JDK's keytool so
* no key material is committed. MinIO reads {@code public.crt} and {@code private.key} (PKCS#8 PEM)
* from its certs directory; the JVM trusts the same certificate through its default trust store
* A throwaway server certificate for one lane run, made with the running JDK's keytool so no key
* material is committed. MinIO reads {@code public.crt} and {@code private.key} (PKCS#8 PEM) from
* its certs directory; the JVM trusts the same certificate through its default trust store
* properties, which the SDK's Netty client reads.
*
* <p>The certificate names localhost and the host the test reaches the container on. They differ
* when the tests run inside a CI job container: there the Docker daemon is another host, and {@code
* localhost} is the job container itself.
*/
final class SelfSignedServerCertificate {
@@ -23,7 +27,7 @@ final class SelfSignedServerCertificate {
private SelfSignedServerCertificate() {}
static Path writeTo(Path directory) throws Exception {
static Path writeTo(Path directory, String containerHost) throws Exception {
String password = password(directory);
Path keytool = Path.of(System.getProperty("java.home"), "bin", "keytool");
Process process =
@@ -44,7 +48,7 @@ final class SelfSignedServerCertificate {
"-dname",
"CN=localhost",
"-ext",
"SAN=dns:localhost,ip:127.0.0.1",
subjectAlternativeNames(containerHost),
"-storetype",
"PKCS12",
"-keystore",
@@ -74,6 +78,15 @@ final class SelfSignedServerCertificate {
return directory;
}
private static String subjectAlternativeNames(String containerHost) {
String names = "SAN=dns:localhost,ip:127.0.0.1";
if (containerHost.equals("localhost") || containerHost.equals("127.0.0.1")) {
return names;
}
boolean ipLiteral = containerHost.contains(":") || containerHost.matches("[0-9.]+");
return names + (ipLiteral ? ",ip:" : ",dns:") + containerHost;
}
/** Points the JVM default trust store at the certificate; the returned action restores it. */
static Runnable trustForThisJvm(Path directory) throws Exception {
String[] names = {
@@ -25,12 +25,16 @@ x-node: &node
image: "redis:${REDIS_VERSION:-7.4}"
network_mode: host
volumes:
- ../../../../../../compose/redis/acl:/etc/redis/acl:ro
- ${REDIS_ACL_DIR:-../../../../../../compose/redis/acl}:/etc/redis/acl:ro
# Through the image's own entrypoint, as the standalone lane is: on Redis 8 that is what loads
# the bundled modules (search, JSON, time series, probabilistic), and without them a topology lane
# would test a different server from the standalone one (FT.INFO absent, 2026-11-09 run 63). It
# also runs the server as the image's redis user instead of root.
entrypoint:
- /bin/sh
- -c
- |
exec redis-server \
exec docker-entrypoint.sh redis-server \
--port $$NODE_PORT \
--cluster-enabled yes \
--cluster-config-file /tmp/nodes.conf \
@@ -29,7 +29,11 @@ x-data-node: &data-node
image: "redis:${REDIS_VERSION:-7.4}"
network_mode: host
volumes:
- ../../../../../../compose/redis/acl:/etc/redis/acl:ro
- ${REDIS_ACL_DIR:-../../../../../../compose/redis/acl}:/etc/redis/acl:ro
# Through the image's own entrypoint, as the standalone lane is: on Redis 8 that is what loads
# the bundled modules (search, JSON, time series, probabilistic), and without them a topology lane
# would test a different server from the standalone one (FT.INFO absent, 2026-11-09 run 63). It
# also runs the server as the image's redis user instead of root.
entrypoint:
- /bin/sh
- -c
@@ -42,7 +46,7 @@ x-data-node: &data-node
# into an explicit NOREPLICAS refusal the caller can see and act on. Any deployment where an
# acknowledgement is supposed to mean something has to set these.
- |
exec redis-server \
exec docker-entrypoint.sh redis-server \
--port $$NODE_PORT \
$$REPLICA_OF \
--appendonly no \
@@ -16,7 +16,7 @@ services:
- --aclfile
- /etc/redis/acl/lane-fixture-accounts.acl
volumes:
- ../../../../../../compose/redis/acl:/etc/redis/acl:ro
- ${REDIS_ACL_DIR:-../../../../../../compose/redis/acl}:/etc/redis/acl:ro
ports:
- "${REDIS_PORT:-6379}:6379"
healthcheck:
@@ -38,7 +38,7 @@ services:
certs:
condition: service_completed_successfully
volumes:
- ../../../../../../compose/redis/acl:/etc/redis/acl:ro
- ${REDIS_ACL_DIR:-../../../../../../compose/redis/acl}:/etc/redis/acl:ro
- tls:/tls:ro
command:
- redis-server
@@ -170,7 +170,7 @@ class DeveloperExperienceContractTest {
.as("a conditional link check is one nobody sees run")
.isFalse();
assertThat(String.valueOf(lycheeStep.get("uses")))
.endsWith("lycheeverse/lychee-action@7cd0af4c74a61395d455af97419279d86aafaede");
.endsWith("lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8");
Map<?, ?> with = requireMap(lycheeStep, "with");
assertThat(with.get("fail")).isEqualTo(true);
assertThat(shellWords(requireString(with, "args")))
@@ -321,7 +321,15 @@ class DeveloperExperienceContractTest {
assertThat(jobsWithTheKey).containsExactly("app-image-signing");
Map<?, ?> signing = requireMap(jobs, "app-image-signing");
assertThat(requireStringList(signing, "needs")).containsExactly("app-image-release");
assertThat(requireString(signing, "if")).contains("github.ref_type == 'tag'");
assertThat(signing.containsKey("if"))
.as("a job with both needs and if never leaves Blocked on this Gitea")
.isFalse();
assertThat(requireList(signing, "steps"))
.as("every step runs only for a tag")
.allSatisfy(
step ->
assertThat(String.valueOf(((Map<?, ?>) step).get("if")))
.contains("github.ref_type == 'tag'"));
String script =
String.join(
"\n",