@@ -82,6 +82,10 @@ public void testFromSamples() throws InterruptedException, ExecutionException, T
82
82
_statistic ,
83
83
future ::complete );
84
84
85
+ // Wait for subscription to be registered and align with aggregation period
86
+ Thread .sleep (1000 );
87
+ sleepToBeginningOfSecond ();
88
+
85
89
try (Metrics metrics = METRICS_FACTORY .create ()) {
86
90
for (int i = 1 ; i <= 10 ; ++i ) {
87
91
for (int j = 1 ; j <= i ; ++j ) {
@@ -90,7 +94,7 @@ public void testFromSamples() throws InterruptedException, ExecutionException, T
90
94
}
91
95
}
92
96
93
- Assert .assertEquals (_expectedResult , future .get (5 , TimeUnit .SECONDS ), 0.0001 );
97
+ Assert .assertEquals (_expectedResult , future .get (30 , TimeUnit .SECONDS ), 0.0001 );
94
98
} finally {
95
99
_telemetryClient .unsubscribe (
96
100
"TelemetryIT" ,
@@ -111,6 +115,8 @@ public void testFromAggregatedData() throws InterruptedException, ExecutionExcep
111
115
_statistic ,
112
116
future ::complete );
113
117
118
+ // Wait for subscription to be registered
119
+ Thread .sleep (1000 );
114
120
sleepToBeginningOfSecond ();
115
121
116
122
try (Metrics metrics = METRICS_FACTORY .create ()) {
@@ -148,7 +154,7 @@ public void testFromAggregatedData() throws InterruptedException, ExecutionExcep
148
154
.build ());
149
155
}
150
156
151
- Assert .assertEquals (_expectedResult , future .get (5 , TimeUnit .SECONDS ), 0.0001 );
157
+ Assert .assertEquals (_expectedResult , future .get (30 , TimeUnit .SECONDS ), 0.0001 );
152
158
} finally {
153
159
_telemetryClient .unsubscribe (
154
160
"TelemetryIT" ,
@@ -168,6 +174,8 @@ public void testFromMixedSamplesAndAggregatedData() throws InterruptedException,
168
174
_statistic ,
169
175
future ::complete );
170
176
177
+ // Wait for subscription to be registered
178
+ Thread .sleep (1000 );
171
179
sleepToBeginningOfSecond ();
172
180
173
181
// First mixed samples-aggregates unit of work
@@ -215,7 +223,7 @@ public void testFromMixedSamplesAndAggregatedData() throws InterruptedException,
215
223
.build ());
216
224
}
217
225
218
- Assert .assertEquals (_expectedResult , future .get (5 , TimeUnit .SECONDS ), 0.0001 );
226
+ Assert .assertEquals (_expectedResult , future .get (30 , TimeUnit .SECONDS ), 0.0001 );
219
227
} finally {
220
228
_telemetryClient .unsubscribe (
221
229
"TelemetryIT" ,
0 commit comments