Skip to content

Tests: Fix module/nomodule tests flakiness#5699

Merged
mgol merged 2 commits intojquery:mainfrom
mgol:module-tests-flakiness
Sep 15, 2025
Merged

Tests: Fix module/nomodule tests flakiness#5699
mgol merged 2 commits intojquery:mainfrom
mgol:module-tests-flakiness

Conversation

@mgol
Copy link
Member

@mgol mgol commented Sep 3, 2025

Summary

The module/nomodule tests are the most flaky ones, contributing significantly to increase number of test failures (somewhat mitigated by auto-retries).

Fix flakiness of module/nomodule tests:

  1. For module tests, increase the timeout to 5 seconds. In order for most tests to not wait that long, change callbacks called by module scripts to verify the results as soon as all scripts have run.
  2. For nomodule tests, run the check in 1 second. All modern browsers will need to wait that long, hence a smaller timeout, and if occasionally the check runs too quickly, the test will still pass.

Checklist

@mgol mgol self-assigned this Sep 3, 2025
@mgol mgol added Needs review Tests Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labels Sep 3, 2025
The module/nomodule tests are the most flaky ones, contributing significantly
to increase number of test failures (somewhat mitigated by auto-retries).

Fix flakiness of module/nomodule tests:
1. For module tests, increase the timeout to 5 seconds. In order for most tests
   to not wait that long, change callbacks called by module scripts to verify
   the results as soon as all scripts have run.
2. For nomodule tests, run the check in 1 second. All modern browsers will
   need to wait that long, hence a smaller timeout, and if occasionally the
   check runs too quickly, the test will still pass.
@mgol mgol requested a review from timmywil September 15, 2025 16:21
@mgol mgol force-pushed the module-tests-flakiness branch from cc6495b to 14f12fa Compare September 15, 2025 16:21
@timmywil timmywil removed the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Sep 15, 2025
@mgol mgol removed the Needs review label Sep 15, 2025
@mgol mgol merged commit 5964acf into jquery:main Sep 15, 2025
17 checks passed
@mgol mgol deleted the module-tests-flakiness branch September 15, 2025 16:27
mgol added a commit that referenced this pull request Sep 15, 2025
The module/nomodule tests are the most flaky ones, contributing significantly
to increase number of test failures (somewhat mitigated by auto-retries).

Fix flakiness of module/nomodule tests:
1. For module tests, increase the timeout to 5 seconds. In order for most tests
   to not wait that long, change callbacks called by module scripts to verify
   the results as soon as all scripts have run.
2. For nomodule tests, run the check in 1 second. All modern browsers will
   need to wait that long, hence a smaller timeout, and if occasionally the
   check runs too quickly, the test will still pass.

Closes gh-5699

(cherry picked from commit 5964acf)
mgol added a commit that referenced this pull request Sep 15, 2025
In IE, these tests are expected to be executed, so the timeout can be higher,
similar to how we set a high timeout for module tests.

Ref gh-5699
@mgol mgol added this to the 3.8.0 milestone Sep 15, 2025
@mgol
Copy link
Member Author

mgol commented Sep 15, 2025

Landed on main in 5964acf (with a small follow-up in 5eab0a3) and on 3.x-stable in c7ccab2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants