Skip to content

Commit 90435c8

Browse files
author
Colman Yau
committed
Update test_live_profiling to avoid inconsistency due to scheduler timer
1 parent 071b59c commit 90435c8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/acceptance/test_live_profiling.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,16 @@ def test_live_profiling(self):
6666
start_status = profiler.start()
6767
assert start_status
6868
assert profiler.is_running()
69-
time.sleep(3)
69+
time.sleep(4)
7070
finally:
7171
profiler.stop()
7272

73-
# We should only see 2 sample in 3 seconds as the sequence should happen in the order of
74-
# no flush -> sample -> no flush -> sample -> flush (without sample)
73+
# We should see at least 2 sample in 4 seconds as the sequence should happen in the order of
74+
# initial delay (1 second)
75+
# After 1 second, no flush -> sample
76+
# After 2 seconds, it attempt to flush (possibly succeed) -> sample/ no sample
77+
# After 3 seconds, it attempt to flush (must succeed if it did not flush before) -> no sample/ sample
78+
# After 4 seconds, no flush -> sample
7579
assert wrapped_add.call_count >= 2
7680
assert wrapped_post_agent_profile.call_count >= 1
7781
assert wrapped_configure_agent.call_count >= 1

0 commit comments

Comments
 (0)