Skip to content
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

Replaying does not wait for pending requests to complete, making them non-deterministic #18

Open
antischematic opened this issue Jan 10, 2023 · 2 comments · May be fixed by #19
Open

Replaying does not wait for pending requests to complete, making them non-deterministic #18

antischematic opened this issue Jan 10, 2023 · 2 comments · May be fixed by #19

Comments

@antischematic
Copy link
Contributor

Related to #12

It's the same problem as before. Tests are completing before the recorded stubs play out, even with delay override set to 0. This causes some requests to fall into the next test case, which there is no stub for. In some cases this causes tests to fail due to failed network requests that should have been stubbed.

We need to add a wait in replay mode that matches the recording behaviour.

@antischematic
Copy link
Contributor Author

Worth noting that I had to simulate 6x CPU slowdown to get some of my tests to fail on my local machine. The problem only became apparent once I ran them on CI.

@Sam152
Copy link
Owner

Sam152 commented Jan 23, 2023

So getting this clear in my mind, once req.reply is called, we should wait until the after:response event is fired before allowing the test to complete?

I do not fully understand why this would fail the next test case. I would imagine between tests when things are mounted and unmounted, the beforeEach function is run again and things are in a relatively fresh state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants