Skip to content

Fix flaky multiprocessing cache timing assertion#1385

Open
jioffe502 wants to merge 1 commit intoNVIDIA:mainfrom
jioffe502:fix/flaky-multiprocessing-cache-test
Open

Fix flaky multiprocessing cache timing assertion#1385
jioffe502 wants to merge 1 commit intoNVIDIA:mainfrom
jioffe502:fix/flaky-multiprocessing-cache-test

Conversation

@jioffe502
Copy link
Collaborator

Description

The test_multiple_processes test asserted that each process's second (cached) call was <50% of its first call's duration. When the cross- process cache works correctly, the second process finds p1's result already cached, making both calls sub-millisecond. OS scheduling noise then randomly violates the ratio, causing spurious CI failures.

fix

Replace the per-process timing assertion with a check that at least one process actually computed the result (took >=50ms from the sleep), validating the cache works without depending on precise timing ratios.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • If adjusting docker-compose.yaml environment variables have you ensured those are mimicked in the Helm values.yaml file.

The test_multiple_processes test asserted that each process's second
(cached) call was <50% of its first call's duration. When the cross-
process cache works correctly, the second process finds p1's result
already cached, making both calls sub-millisecond. OS scheduling noise
then randomly violates the ratio, causing spurious CI failures.

Replace the per-process timing assertion with a check that at least one
process actually computed the result (took >=50ms from the sleep),
validating the cache works without depending on precise timing ratios.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
@jioffe502 jioffe502 requested a review from a team as a code owner February 6, 2026 18:27
@jioffe502 jioffe502 requested a review from jperez999 February 6, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant