Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make the TDS size-sub-failure test more deterministic #6588

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jmao-denver
Copy link
Contributor

I have manually run the Nightly check 3 times and the fix seems to have worked.

@jmao-denver jmao-denver added this to the 0.38.0 milestone Jan 22, 2025
@jmao-denver jmao-denver self-assigned this Jan 22, 2025
Comment on lines +363 to +370
table.coalesce()
# wait for the size subscription failure callback to be called for 5 seconds
for _ in range(50):
time.sleep(0.1)
if backend.is_size_sub_failure_cb_called:
break
else:
self.fail("size subscription failure callback was not called in 5s")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably better than what you had, although I really don't like seeing this kind of sleep loop; does Python not have condition variables?

with self.assertRaises(Exception) as cm:
# failure_cb will be called in the background thread after 2 PUG cycles, 3 seconds timeout should be enough
self.wait_ticking_table_update(table, 600, 3)
self.wait_ticking_table_update(table, 600, 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect you need 2 seconds (2 cycles) to be safe if you're using a real PeriodicUpdateGraph with a 1 second interval. The failure is buffered after the roots are processed on one cycle, it won't be delivered until the next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants