Skip to content

Commit 1c5add3

Browse files
authored
less flaky with await (#2533)
1 parent 298a931 commit 1c5add3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

inferred-spans/src/test/java/io/opentelemetry/contrib/inferredspans/internal/SamplingProfilerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ void testProfileTransaction() throws Exception {
177177
try (Scope scope = tx.makeCurrent()) {
178178
// makes sure that the rest will be captured by another profiling session
179179
// this tests that restoring which threads to profile works
180-
Thread.sleep(600);
180+
int currentSession = setup.profiler.getProfilingSessions();
181+
await().until(() -> setup.profiler.getProfilingSessions() > currentSession);
181182
profilingActiveOnThread = setup.profiler.isProfilingActiveOnThread(Thread.currentThread());
182183
aInferred(tracer);
183184
} finally {

0 commit comments

Comments
 (0)