Skip to content

Test action events should not be emitted after ending the test #5650

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

Closed
wentwrong opened this issue Oct 21, 2020 · 0 comments
Closed

Test action events should not be emitted after ending the test #5650

wentwrong opened this issue Oct 21, 2020 · 0 comments
Assignees
Labels
SYSTEM: reporting TYPE: bug The described behavior is considered as wrong (bug).

Comments

@wentwrong
Copy link
Contributor

We should prevent emitting test action events after the test with corresponding actions has finished.

There are some cases when test action events (test-action-start and test-action-done) can be emitted after the test has already finished running. In one such case it caused an error with BrowserProvider, because eval was placed in a chain with preceding wait action:

await t
    .wait(timeout)
    .eval(() => location.reload(true));

Since the actions preceding eval in this chain are called without await-ing them, the events got desynchronized. The test-action-done event of the wait action was called after the test has already finished and hence browser was closed. The event handler of test-action-done performed call to the isHeadlessBrowser method of the BrowserProvider, which crashed with an unexpected error.

Navigate to the original ticket in order to get the stack trace and reproducible example: Investigate the problem with BrowserProvider caused by extended log reporter.

@wentwrong wentwrong added TYPE: bug The described behavior is considered as wrong (bug). SYSTEM: reporting labels Oct 21, 2020
@miherlosev miherlosev self-assigned this Mar 12, 2021
miherlosev added a commit to miherlosev/testcafe that referenced this issue Mar 12, 2021
miherlosev added a commit to miherlosev/testcafe that referenced this issue Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SYSTEM: reporting TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

2 participants