-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 using wrapped rethrowAsync
take a very long time.
#25725
Comments
to/ @ampproject/wg-infra cc/ @ampproject/wg-ads |
Had another thought, maybe this is slow because we are passing around the whole error stack? Just a guess though. |
Nice sleuthing, @calebcordry. For context, I agree we should work on improving how tests can legitimately surface errors. Happy to discuss ideas. /cc @estherkim who is going to work on overall test reliability. |
Thanks! I actually like the idea of the stubbed errors etc, but I think this stubception™ might be confusing sinon. Maybe we can convince them to work on their perf for things like this :) |
Resetting assignees since our projects have changed since this was filed. However, I think this is a good area to investigate, since the potential gains can be very high. Bumping to P2. |
I can't seem to reproduce this issue anymore. If anyone thinks this is still happening, please reopen this ticket. |
I don't think this is a problem on travis because we increase the timeout limit, but when running tests locally this causes consistent failure on macbook pro.
We have a function that stubs usage of
rethrowAsync
in testsamphtml/test/_init_tests.js
Line 375 in d1a7ee5
This stub eventually calls
amphtml/test/_init_tests.js
Line 380 in d1a7ee5
In these stubed tests
self.__AMP_REPORT_ERROR()
is a ref toamphtml/src/error.js
Line 150 in d1a7ee5
In that function we call
amphtml/src/error.js
Line 200 in d1a7ee5
That line of code takes between 2.7 - 3.1 seconds to execute on my laptop!!?!!?
console error here is also stubbed to be a no op
amphtml/test/_init_tests.js
Line 321 in d1a7ee5
I put some
console.time
s in here to see what was going on, and from the call to the time the NOOP function is executed accounts for the slowness. Unfortunately all the code that is executed in between is part of our external testing packages so I am not sure there is a good fix. Maybe reevalute how we are stubbing things?If you want to see my "profiling" I have a draft pr here #25724 if you pull those changes and run
gulp unit --files=test/unit/test-3p.js --verbose
you should be able to repro and see some times being logged.The text was updated successfully, but these errors were encountered: