Skip to content

Commit

Permalink
Merge pull request ceph#225 from baum/state-notify-test-tweak
Browse files Browse the repository at this point in the history
test_state: test_state_notify_update
  • Loading branch information
baum authored Sep 10, 2023
2 parents 940f228 + 12df814 commit f72f016
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,16 @@ def _state_notify_update(update, is_add_req):
omap_state.OMAP_VERSION_KEY)
assert (ioctx.notify(omap_state.omap_name)) # Send notify signal

time.sleep(0.5)
# any wait interval smaller than update_interval_sec = 10 should be good
# to test notify capability
elapsed = time.time() - start
wait_interval = update_interval_sec - elapsed - 0.5
assert(wait_interval > 0)
assert(wait_interval < update_interval_sec)
time.sleep(wait_interval)

# expect 4 updates: addition, two-step change and removal
# registered before update_interval_sec
assert update_counter == 4
elapsed = time.time() - start
assert elapsed < update_interval_sec

0 comments on commit f72f016

Please sign in to comment.