>From Michael Blow <[email protected]>:

Michael Blow has submitted this change. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21364?usp=email )

Change subject: [NO ISSUE][TEST] Stream s3mock's stdout/stderr to log
......................................................................

[NO ISSUE][TEST] Stream s3mock's stdout/stderr to log

Change-Id: Ie1f774da45700a0083eaadbc07890c7356314563
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21364
Reviewed-by: Michael Blow <[email protected]>
Reviewed-by: Hussain Towaileb <[email protected]>
Integration-Tests: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
---
M 
asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/LocalCloudUtilAdobeMock.java
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Jenkins: Verified; Verified
  Michael Blow: Looks good to me, but someone else must approve
  Hussain Towaileb: Looks good to me, approved




diff --git 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/LocalCloudUtilAdobeMock.java
 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/LocalCloudUtilAdobeMock.java
index b9b0858..32f3a67 100644
--- 
a/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/LocalCloudUtilAdobeMock.java
+++ 
b/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/LocalCloudUtilAdobeMock.java
@@ -30,6 +30,7 @@
 import java.nio.file.Path;
 import java.util.Map;

+import org.apache.hyracks.util.annotations.AiProvenance;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;

@@ -78,6 +79,7 @@
         return startS3CloudEnvironment(cleanStart, false);
     }

+    @AiProvenance(agent = AiProvenance.Agent.CLAUDE_OPUS_4_8, tool = 
AiProvenance.Tool.CLAUDE_CODE_UI, contributionKind = 
AiProvenance.ContributionKind.ASSISTED, notes = "stream the S3 mock container's 
logs into the test log for diagnosing mock-side failures")
     public static S3MockContainer startS3CloudEnvironment(boolean cleanStart, 
boolean createPlaygroundContainer)
             throws IOException {
         // Testcontainers 1.21.x defaults to Docker API version 1.32, but 
Docker Desktop 4.65.0+ requires
@@ -100,6 +102,15 @@
             //if RetainFilesOnExist is false
             s3Mock.withVolumeAsRoot(s3MockDataDir.toAbsolutePath());
         }
+        // stream the mock container's own logs into the test log so S3 mock 
failures (e.g. the server becoming
+        // unresponsive under concurrent load) are diagnosable; otherwise the 
container is removed at teardown
+        // with no trace of what it logged.
+        s3Mock.withLogConsumer(frame -> {
+            String line = frame.getUtf8StringWithoutLineEnding();
+            if (line != null && !line.isEmpty()) {
+                LOGGER.info("[s3mock] {}", line);
+            }
+        });
         s3Mock.start();
         LOGGER.info("S3 mock server started successfully");
         DOCKER_ADOBE_S3_MOCK_URI = MOCK_SERVER_HOSTNAME_FRAGMENT + 
s3Mock.getHttpServerPort();

--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21364?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: Ie1f774da45700a0083eaadbc07890c7356314563
Gerrit-Change-Number: 21364
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Blow <[email protected]>
Gerrit-Reviewer: Hussain Towaileb <[email protected]>
Gerrit-Reviewer: Ian Maxon <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Michael Blow <[email protected]>

Reply via email to