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

✅ improve async calls collection #2123

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

BenoitZugmeyer
Copy link
Member

Motivation

The asynchronous call collection utility is a bit complex and suboptimal
as we wait 300ms for each test to check whether some calls are done
after the end of assertions.

Changes

  • Do not wait for 300ms to check for extra calls

  • Simplify usage by asserting no extra calls are done automatically

  • Help debugging by printing the spec name when an asynchronous call is
    done after the spec finished.

This change reduces tests execution time by 5 seconds on my machine.

Before:

Chrome Headless 111.0.5563.146 (Mac OS 10.15.7): Executed 1779 of 1782 (skipped 3) SUCCESS (16.335 secs / 15.842 secs)

After:

Chrome Headless 111.0.5563.146 (Mac OS 10.15.7): Executed 1779 of 1782 (skipped 3) SUCCESS (11.037 secs / 10.619 secs)

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@BenoitZugmeyer BenoitZugmeyer requested review from a team as code owners March 30, 2023 09:40
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

* Do not wait for 300ms to check for extra calls
* Simplify usage by asserting no extra calls are done automatically
* Help debugging by printing the spec name when an asynchronous call is
  done after the spec finished.
@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/improve-async-calls-collection branch from 92a2139 to ac44e59 Compare March 30, 2023 09:44
@codecov-commenter
Copy link

Codecov Report

Merging #2123 (ac44e59) into main (dd72371) will decrease coverage by 0.13%.
The diff coverage is 80.95%.

@@            Coverage Diff             @@
##             main    #2123      +/-   ##
==========================================
- Coverage   93.68%   93.56%   -0.13%     
==========================================
  Files         178      179       +1     
  Lines        5974     5983       +9     
  Branches     1341     1342       +1     
==========================================
+ Hits         5597     5598       +1     
- Misses        377      385       +8     
Impacted Files Coverage Δ
packages/core/test/collectAsyncCalls.ts 73.33% <69.23%> (-12.39%) ⬇️
packages/core/test/getCurrentJasmineSpec.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@bcaudan bcaudan left a comment

Choose a reason for hiding this comment

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

Nice!

@BenoitZugmeyer BenoitZugmeyer merged commit 4ad4ba4 into main Mar 30, 2023
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/improve-async-calls-collection branch March 30, 2023 17:20
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.

3 participants