Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests/Perf] Disable 100ms timeout in each waitForChanges() #10433

Open
maxpatiiuk opened this issue Sep 28, 2024 · 0 comments
Open

[Tests/Perf] Disable 100ms timeout in each waitForChanges() #10433

maxpatiiuk opened this issue Sep 28, 2024 · 0 comments
Assignees
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.

Comments

@maxpatiiuk
Copy link
Member

maxpatiiuk commented Sep 28, 2024

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.

Lumina provides a backwards compatible waitForChanges() with two improvements:

  • In dev mode, maintains a list of WeakRefs to all created components so that we can cheaply detect which of them are still loading/updating.
  • In waitForChanges() ensure each component is loaded if not yet loaded. If it's already loaded, ensure all updates are completed.
  • Do not wait 100ms, but do allow a config option to add back this delay for compatibility with Stencil - see below for more info.

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:


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

@maxpatiiuk maxpatiiuk added testing Issues related to automated or manual testing. 0 - new New issues that need assignment. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. labels Sep 28, 2024
@github-actions github-actions bot added the p - medium Issue is non core or affecting less that 60% of people using the library label Sep 28, 2024
@jcfranco jcfranco self-assigned this Oct 9, 2024
@jcfranco jcfranco added estimate - 3 A day or two of work, likely requires updates to tests. blocked This issue is blocked by another issue. labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants