@@ -41,7 +41,7 @@ public class CrashtrackingSmokeTest {
41
41
private static Path LOG_FILE_DIR ;
42
42
private MockWebServer tracingServer ;
43
43
private TestUDPServer udpServer ;
44
- private BlockingQueue <CrashTelemetryData > crashEvents = new LinkedBlockingQueue <>();
44
+ private final BlockingQueue <CrashTelemetryData > crashEvents = new LinkedBlockingQueue <>();
45
45
46
46
@ BeforeAll
47
47
static void setupAll () {
@@ -65,7 +65,9 @@ void setup() throws Exception {
65
65
tracingServer .setDispatcher (
66
66
new Dispatcher () {
67
67
@ 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
+
69
71
String data = request .getBody ().readString (StandardCharsets .UTF_8 );
70
72
71
73
if ("/telemetry/proxy/api/v2/apmtelemetry" .equals (request .getPath ())) {
@@ -82,7 +84,7 @@ public MockResponse dispatch(final RecordedRequest request) throws InterruptedEx
82
84
System .out .println ("Unable to parse " + e );
83
85
}
84
86
}
85
- System . out . println ( "URL ====== " + request . getPath ());
87
+
86
88
System .out .println (data );
87
89
88
90
return new MockResponse ().setResponseCode (200 );
@@ -92,9 +94,7 @@ public MockResponse dispatch(final RecordedRequest request) throws InterruptedEx
92
94
udpServer = new TestUDPServer ();
93
95
udpServer .start ();
94
96
95
- synchronized (outputThreads .testLogMessages ) {
96
- outputThreads .testLogMessages .clear ();
97
- }
97
+ outputThreads .clearMessages ();
98
98
}
99
99
100
100
@ AfterEach
@@ -227,12 +227,11 @@ void testOomeTracking() throws Exception {
227
227
"-jar" ,
228
228
appShadowJar (),
229
229
script .toString ()));
230
+ pb .environment ().put ("DD_DOGSTATSD_PORT" , String .valueOf (udpServer .getPort ()));
230
231
231
232
Process p = pb .start ();
232
233
outputThreads .captureOutput (
233
234
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" ));
236
235
237
236
assertNotEquals (0 , p .waitFor (), "Application should have crashed" );
238
237
assertOOMEvent ();
@@ -264,8 +263,6 @@ void testCombineTracking() throws Exception {
264
263
pb .environment ().put ("DD_TRACE_AGENT_PORT" , String .valueOf (tracingServer .getPort ()));
265
264
pb .environment ().put ("DD_DOGSTATSD_PORT" , String .valueOf (udpServer .getPort ()));
266
265
267
- System .out .println ("Set port to: " + pb .environment ().get ("DD_DOGSTATSD_PORT" ));
268
-
269
266
Process p = pb .start ();
270
267
outputThreads .captureOutput (
271
268
p , LOG_FILE_DIR .resolve ("testProcess.testCombineTracking.log" ).toFile ());
0 commit comments