[Tests/Perf] Disable 100ms timeout in each waitForChanges() #10433
Labels
0 - new
New issues that need assignment.
blocked
This issue is blocked by another issue.
estimate - 3
A day or two of work, likely requires updates to tests.
needs milestone
Planning workflow - pending milestone assignment, has priority and/or estimate.
p - medium
Issue is non core or affecting less that 60% of people using the library
testing
Issues related to automated or manual testing.
Priority impact
p - medium
Test type
E2E tests
Which Component(s)
all
Unstable Tests
Blocked by #10310
Stencil's implementation of
waitForChanges()
had some issues.waitForChanges()
Lumina provides a backwards compatible waitForChanges() with two improvements:
waitForChanges()
ensure each component is loaded if not yet loaded. If it's already loaded, ensure all updates are completed.With the 100ms wait, Calcite E2E tests run in Lumina+Vitest at about the same speed as in Stencil+Jest.
Without 100ms wait, Calcite's E2E tests run ~40% faster.
BUT, Calcite's E2E tests do not disable animations (default duration seems to be 150ms in many places) and some tests are asserting the element computedStyles after animation is completed.
While Stencil's waitForChanges only waits for 100ms, the fact that you always call waitForChanges twice in assertThemedProps(), made it wait 200ms, thus the test was passing.
If I remove the 100ms delay, these tests start to fail. I added it back for now to simplify the migration.
TODO:
newE2EPage
already does it:calcite-design-system/packages/calcite-components/src/tests/commonTests/utils.ts
Line 42 in 9312e29
calcite-design-system/packages/calcite-components/src/tests/commonTests/formAssociated.ts
Lines 423 to 424 in 42c1329
P.S.: I imagine more speed ups from transition to Vitest browser mode as then it would reduce the need for each component interaction to be a separate async action (you would just be calling DOM APIs directly), and reduce the need to sync the HTML content between the browser and node.js after every change.
Thus, you may choose to do bare minimum performance optimization at the moment, and wait for migration to Vitest browser mode instead.
Test error, if applicable
No response
PR skipped, if applicable
No response
Additional Info
No response
The text was updated successfully, but these errors were encountered: