Skip to content

Commit 018ab29

Browse files
committed
add a delay for websocket registration
1 parent adb0101 commit 018ab29

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/java/com/arpnetworking/metrics/mad/integration/TelemetryIT.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public void testFromSamples() throws InterruptedException, ExecutionException, T
8282
_statistic,
8383
future::complete);
8484

85+
// Wait for subscription to be registered and align with aggregation period
86+
Thread.sleep(1000);
87+
sleepToBeginningOfSecond();
88+
8589
try (Metrics metrics = METRICS_FACTORY.create()) {
8690
for (int i = 1; i <= 10; ++i) {
8791
for (int j = 1; j <= i; ++j) {
@@ -111,6 +115,8 @@ public void testFromAggregatedData() throws InterruptedException, ExecutionExcep
111115
_statistic,
112116
future::complete);
113117

118+
// Wait for subscription to be registered
119+
Thread.sleep(1000);
114120
sleepToBeginningOfSecond();
115121

116122
try (Metrics metrics = METRICS_FACTORY.create()) {
@@ -168,6 +174,8 @@ public void testFromMixedSamplesAndAggregatedData() throws InterruptedException,
168174
_statistic,
169175
future::complete);
170176

177+
// Wait for subscription to be registered
178+
Thread.sleep(1000);
171179
sleepToBeginningOfSecond();
172180

173181
// First mixed samples-aggregates unit of work

0 commit comments

Comments
 (0)