Skip to content

Conversation

@hainenber
Copy link
Contributor

PR Checklist

Overview

Fixes the issue with timeout chain call in describe suite doesn't correctly override the config for inner/nested suite and test cases.

hainenber and others added 4 commits January 4, 2026 15:24
…ed in chain call

Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
@hainenber hainenber changed the title Fix/allow chain call timeout to override nested items timeout fix: allow chain call timeout to override nested items timeout Jan 4, 2026
@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.41%. Comparing base (0ed524a) to head (a589e40).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5612   +/-   ##
=======================================
  Coverage   88.40%   88.41%           
=======================================
  Files          66       66           
  Lines        4787     4791    +4     
  Branches      977      977           
=======================================
+ Hits         4232     4236    +4     
  Misses        555      555           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

setTimeout(resolve, 55);
});
});
}).timeout(70);
Copy link
Member

Choose a reason for hiding this comment

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

hmm, I'm not sure how timeout(70) and timeout(100) result in different behavior when we have setTimeout(resolve, 55). Would replacing 70 with 40 clarify things? Do we need two tests for this?

Some code comments might be useful here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The chained timeout calls are meant to imply that the outermost timeout value would override for nested test cases and suites. In general, timeout(100) would take precedence over other timeout configs.

We'll definitely need 2 test to illustrate for nested and deeply nested cases :D

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've added code comments for clarity, that is if sufficient.

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 think I'll extend the timeout a bit higher than the default value, 2 second, to illustrate the fix better. Con is that the test will be slightly longer.

Edit: Done

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little new to the codebase and I'm sorry if I'm out of line here but it seems like these are arbitrary values that indicate a deeper root issue and this seems to be a bandaid fix?

Copy link
Member

@mark-wiemer mark-wiemer Jan 4, 2026

Choose a reason for hiding this comment

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

No worries. These are arbitrary values in some sample tests to demonstrate that the new sleep values do actually apply. The backing bug was reported because in main*, with something like describe( ... ).timeout(100);, the timeout(100) call didn't do anything at all.

While I haven't reviewed the latest iterations, the goal is to write a test that only passes if timeout(...) works as designed on both describe and test.

But this isn't a bandaid fix, because these are just sample tests :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense now :)

@mark-wiemer mark-wiemer added the status: waiting for author waiting on response from OP or other posters - more information needed label Jan 4, 2026
hainenber and others added 3 commits January 4, 2026 22:46
Co-authored-by: Mark Wiemer <7833360+mark-wiemer@users.noreply.github.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
…clearer

Signed-off-by: hainenber <dotronghai96@gmail.com>
@mark-wiemer mark-wiemer removed the status: waiting for author waiting on response from OP or other posters - more information needed label Jan 4, 2026
@mark-wiemer mark-wiemer added the status: needs review a maintainer should (re-)review this pull request label Jan 4, 2026
@mark-wiemer mark-wiemer self-assigned this Jan 4, 2026
@mark-wiemer mark-wiemer added this to the v12.x milestone Jan 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs review a maintainer should (re-)review this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Bug: timeout() chain call on describe not working as expected

3 participants