Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
feat(core): add task tracking to Testability #16863
Allow passing an optional timeout to Testability's whenStable(). If
Also, allows an optional update callback, which will be invoked whenever
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
What is the new behavior?
Users can now pass a timeout to
Does this PR introduce a breaking change? (check one with "x")
2 times, most recently
May 18, 2017
IgorMinar left a comment
How do we expect developers to receive this update?
I suspect that once they update to karma that depends on this API they will get the missing zone spec error, not understanding what that means or what to do about it.
If they read up on the change in some changelog they'll figure out that they need to add the new zone spec.
If they do add these zone spec, would they know how to remove them in production?
And if they are not removed from production builds, do we understand the performance impact of having task tracking enabled all the time?
It seems to me that the PR as is will create a lot of pain for developers not suspecting or understanding this change. Am I missing something?
That should not happen - at least it's not the intention. The error for the missing zone spec is only thrown when someone tries to call
The current behavior for Protractor is to pass a done callback and wait forever. The timeout is actually handled by WebDriver's script execution timeout. Moving the timeout and task tracking logic to Testability will allow us to greatly simplify Protractor's browser.waitForAngular
That's a good point, which Misko brought up when we talked this idea over with him. The goal is to fix that with #17390, which adds a way to explicitly set which zone specs get loaded by setting flags in session state. The idea is that if
The goal of this PR is to preserve current behavior, but allow us to add task tracking in future Protractor releases. This will provide better debugging information when Protractor times out waiting for stability, and will also enable us to build a more high-level API for waiting on macrotasks. The change should be transparent. If Protractor attempts to use task tracking but the zone isn't present, it can log a warning (or error or whatever we decide is appropriate).
Once #17390 is in we'll be able to continue this work on the Protractor side. We're also planning on doing the same changes to whenStable for AngularJS.