Skip to content

Conversation

@haoxli
Copy link
Contributor

@haoxli haoxli commented Jan 14, 2026

Added a per-test endTestScope timeout function so heavy cases can extend the time without slowing down the rest of the suite, and used it to give the 64K timestamp-query stress test run extra headroom, avoiding flakes while leaving the default 5000ms limit untouched elsewhere.

Issue: #


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (If not passing, explain above.)
  • Test have be tested with compatibility mode validation enabled and behave as expected. (If not passing, explain above.)

Requirements for reviewer sign-off:

  • Tests are properly located.
  • Test descriptions are accurate and complete.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Tests avoid over-parameterization (see case count report).

When landing this PR, be sure to make any necessary issue status updates.

Added a per-test endTestScope timeout function so heavy cases can extend
the time without slowing down the rest of the suite, and used it to give
the 64K timestamp-query stress test run extra headroom, avoiding flakes
while leaving the default 5000ms limit untouched elsewhere.
@haoxli haoxli requested a review from kainino0x January 14, 2026 07:39
@github-actions
Copy link

Results for build job (at 52edcaa):

 Test case/subcase counts did not change.


if (numQuerySets === 65536) {
// Allow extra time for massive timestamp query allocation/cleanup churn.
t.setEndTestScopeTimeout(10000);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if I want to make this part of the "official" interface of the test fixture. It seems a bit fragile or easy to misuse because it's very specific to the test why this might need to be done.

Would it work to wait inside the test by just doing await t.queue.onSubmittedWorkDone() at the end before returning from the test function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I try it not work for this timeout case. This failure was not because the test ended before the commands were completed, but rather because it didn't have enough time to finish the tests (includes waiting submitted commands done + error scop popping + celanup). I think what we need here is a mechanism to increase the execution time of cases that require long execution times.

To avoid exposing it as a public interface and thus causing misuse, how about make the framework to auto-detect slow tests and extend timeouts automatically, if the default timeout in endTestScope is hit, run the case again with twice the default timeout. However, this approach increases the overall runtime of the test suite if a network-related timeout occurs.

Another idea is whether we can move this case into the stress test src/stress/queries/timestamps.spec.ts. I see there are some stress tests for render/compute pass are unimplemented, It would be reasonable to set a separate timeout for them.

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.

2 participants