data icon indicating copy to clipboard operation
data copied to clipboard

Async waiter should be turned on by default

Open runspired opened this issue 5 years ago • 8 comments

A while back we added a waiter for requests, the ability to generate stack traces, and additional infra for helping prevent async test leakage. We should turn on the waiter (and most of this other infra) by default.

runspired avatar Nov 11 '19 19:11 runspired

Can we re-evaluate the implementation (e.g. switch to using ember-test-waiters, which has direct @ember/test-helpers integration)? Are we already using that?

rwjblue avatar Nov 13 '19 23:11 rwjblue

@rwjblue this is different from

import { registerWaiter, unregisterWaiter } from '@ember/test';

?

runspired avatar Nov 13 '19 23:11 runspired

Our current implementation is this:

      this.__asyncWaiter = () => {
        let shouldTrack = this.shouldTrackAsyncRequests;
        let tracked = this._trackedAsyncRequests;
        let isSettled = tracked.length === 0;

        return shouldTrack !== true || isSettled;
      };

      registerWaiter(this.__asyncWaiter);

runspired avatar Nov 13 '19 23:11 runspired

this is different from ... ?

Ya, the new API is better 😄 (and is compatible with older versions).

rwjblue avatar Nov 13 '19 23:11 rwjblue

The repo README has info over in https://github.com/rwjblue/ember-test-waiters.

rwjblue avatar Nov 13 '19 23:11 rwjblue

We moved the repo over to https://github.com/emberjs/ember-test-waiters.

rwjblue avatar Mar 11 '20 21:03 rwjblue

going to hold off on this until pairing to refactor to new syntax to ensure the debug experience is as good as possible when something is left pending

runspired avatar Mar 11 '20 21:03 runspired

@rwjblue we're going to move ahead with activating this since external waiters seem to not work as well in 4.x now that fetch is the default. We should still pair on that refactor though!!

runspired avatar Feb 17 '22 17:02 runspired

This is now always on

runspired avatar Nov 17 '22 02:11 runspired