Skip to content

Test isolation validation should include canceling active test waiters in ember-test-watiers #488

Open

Description

@scalvert

The ember-test-waiters library will soon include an API to cancel all pending waiters. This is a similar concept to where we cancel timers if test isolation validation is triggered:

.finally(() => {
// canceling timers here isn't perfect, but is as good as we can do
// to attempt to prevent future tests from failing due to this test's
// leakage
run.cancelTimers();
return doFinish();

This will help ensure that we don't leak state from one test to another, potentially 'wedging' the test waiters and creating an inconsistent state.

Activity

  1. rwjblue commented on May 13, 2019

    @rwjblue
    Member

    I'm a bit on the fence here, while I agree that it might seem nice to have I do not think that we can actually cancel the async operation that the waiters are paused on. This means that while the waiters will not pause tests any more, you actually are in a broken state. Silently swallowing that seems extremely bad...

  2. scalvert commented on May 13, 2019

    @scalvert
    ContributorAuthor

    Had a good chat with @rwjblue offline. We agreed that adding this API will likely result in leaks actually occurring, defeating the point of the waiters.

    We discussed evaluating settled when a test starts, and if we're not in a settled state, fail hard then so we don't incorrectly signal test failures on successive tests.

  3. rwjblue commented on May 17, 2019

    @rwjblue
    Member

    @scalvert - Should we close then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions