Skip to content

Fix test_timing flakiness under Windows #508

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

Merged
merged 2 commits into from
Mar 12, 2025
Merged

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Mar 11, 2025

Observed:

> assert delay_ms <= elapsed_time_ms < delay_ms + generous_tolerance
E assert 500.0 <= 490.03173828125
test_event.py:41: AssertionError

The generous_tolerance also needs to be applied when checking the lower bound.

Observed:

```
> assert delay_ms <= elapsed_time_ms < delay_ms + generous_tolerance
E assert 500.0 <= 490.03173828125
test_event.py:41: AssertionError
```

The generous_tolerance also needs to be applied when checking the lower bound.
Copy link
Contributor

copy-pr-bot bot commented Mar 11, 2025

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@rwgk
Copy link
Collaborator Author

rwgk commented Mar 11, 2025

/ok to test

This comment has been minimized.

@leofang leofang added this to the cuda.core beta 3 milestone Mar 11, 2025
@leofang leofang added bug Something isn't working P0 High priority - Must do! test Improvements or additions to tests cuda.core Everything related to the cuda.core module labels Mar 11, 2025
leofang
leofang previously approved these changes Mar 11, 2025
@leofang
Copy link
Member

leofang commented Mar 12, 2025

Since the CI was green and the last commit is comment-only, go ahead and admin-merge it.

@leofang leofang merged commit 406b81c into NVIDIA:main Mar 12, 2025
1 check passed
Copy link

Doc Preview CI
Preview removed because the pull request was closed or merged.

@rwgk rwgk deleted the test_timing_fix2 branch March 12, 2025 04:25
@@ -37,8 +38,13 @@ def test_timing(init_cuda, enable_timing):
# We only want to exercise the __sub__ method, this test is not meant
# to stress-test the CUDA driver or time.sleep().
delay_ms = delay_seconds * 1000
generous_tolerance = 20
assert delay_ms <= elapsed_time_ms < delay_ms + generous_tolerance
if os.name == "nt": # noqa: SIM108
Copy link
Contributor

Choose a reason for hiding this comment

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

what do we gain by giving different tolerances to each OS? could we set both to 100?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but this is a little stricter; I figured Leo believes that's better.

In the long run, assuming that everything is stable (cuda.core released, and this usually works), a tighter tolerance could uncover new bugs elsewhere. So we'd contribute to the greater good.

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't even notice that it was already merged ha. Looks good to me, I was mostly just curious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cuda.core Everything related to the cuda.core module P0 High priority - Must do! test Improvements or additions to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants