@@ -41,7 +41,7 @@ public class CrashtrackingSmokeTest {
4141 private static Path LOG_FILE_DIR ;
4242 private MockWebServer tracingServer ;
4343 private TestUDPServer udpServer ;
44- private BlockingQueue <CrashTelemetryData > crashEvents = new LinkedBlockingQueue <>();
44+ private final BlockingQueue <CrashTelemetryData > crashEvents = new LinkedBlockingQueue <>();
4545
4646 @ BeforeAll
4747 static void setupAll () {
@@ -65,7 +65,9 @@ void setup() throws Exception {
6565 tracingServer .setDispatcher (
6666 new Dispatcher () {
6767 @ Override
68- public MockResponse dispatch (final RecordedRequest request ) throws InterruptedException {
68+ public MockResponse dispatch (final RecordedRequest request ) {
69+ System .out .println ("URL ====== " + request .getPath ());
70+
6971 String data = request .getBody ().readString (StandardCharsets .UTF_8 );
7072
7173 if ("/telemetry/proxy/api/v2/apmtelemetry" .equals (request .getPath ())) {
@@ -82,7 +84,7 @@ public MockResponse dispatch(final RecordedRequest request) throws InterruptedEx
8284 System .out .println ("Unable to parse " + e );
8385 }
8486 }
85- System . out . println ( "URL ====== " + request . getPath ());
87+
8688 System .out .println (data );
8789
8890 return new MockResponse ().setResponseCode (200 );
@@ -92,9 +94,7 @@ public MockResponse dispatch(final RecordedRequest request) throws InterruptedEx
9294 udpServer = new TestUDPServer ();
9395 udpServer .start ();
9496
95- synchronized (outputThreads .testLogMessages ) {
96- outputThreads .testLogMessages .clear ();
97- }
97+ outputThreads .clearMessages ();
9898 }
9999
100100 @ AfterEach
@@ -227,12 +227,11 @@ void testOomeTracking() throws Exception {
227227 "-jar" ,
228228 appShadowJar (),
229229 script .toString ()));
230+ pb .environment ().put ("DD_DOGSTATSD_PORT" , String .valueOf (udpServer .getPort ()));
230231
231232 Process p = pb .start ();
232233 outputThreads .captureOutput (
233234 p , LOG_FILE_DIR .resolve ("testProcess.testOomeTracking.log" ).toFile ());
234- pb .environment ().put ("DD_DOGSTATSD_PORT" , String .valueOf (udpServer .getPort ()));
235- System .out .println ("Set port to: " + pb .environment ().get ("DD_DOGSTATSD_PORT" ));
236235
237236 assertNotEquals (0 , p .waitFor (), "Application should have crashed" );
238237 assertOOMEvent ();
@@ -264,8 +263,6 @@ void testCombineTracking() throws Exception {
264263 pb .environment ().put ("DD_TRACE_AGENT_PORT" , String .valueOf (tracingServer .getPort ()));
265264 pb .environment ().put ("DD_DOGSTATSD_PORT" , String .valueOf (udpServer .getPort ()));
266265
267- System .out .println ("Set port to: " + pb .environment ().get ("DD_DOGSTATSD_PORT" ));
268-
269266 Process p = pb .start ();
270267 outputThreads .captureOutput (
271268 p , LOG_FILE_DIR .resolve ("testProcess.testCombineTracking.log" ).toFile ());
0 commit comments