Skip to content

Acceptance tests do not wait for all requests during a store merge #173

@chbonser

Description

@chbonser

The Problem

I'm chasing a bug in an existing project where a number of acceptance tests started failing because some (all?) of the async test helpers from ember-test-helpers lost the ability to know the app is settled. For example a await click line in a test will continue forward while async stuff (ember-concurrency task and ajax calls) are still running.

Backstory

I say 'lost' above because this occurred in an existing project where we've been using orbit for a few months. The tests have been rock solid until... I added ember-auto-import as a top level dependency. Super weird right? I couldn't make heads of tails of that one, so I started a new project to reproduce the issue in an app with fewer dependencies.

Reproduction App

I've been able to reproduce the failure in this public app https://github.com/forge512/async-test-bug.

The app has component which runs an ember-concurrency task to create 4 posts component. And it has a test which verifies it works.

Experiment 1 (ember-data parallel save)

I used ember-data to fire requests to create 4 posts with parallel requests. See the use of ember-concurrency all here.

Tests pass.

Experiment 2 (ember-data parallel save)

In this branch, I adapted the component to fire the requests in serial.

Tests pass.

Experiment 3 (orbit with store forking)

In this branch, I switch to using orbit with a blocking remote store. The component forks the store, adds 4 posts, then merges the store.

Tests fail.

Summary

I'm not sure why one app (the private repo) worked until adding ember-auto-import. I'm also not sure why the example app failed in experiment 3. I had expected experiment 3 to pass, but then mysteriously fail when I added ember-auto-import.

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