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

[QUESTION] How can I forcefully abort a testcase and advance to next in queue #1755

Open
aravinth-r-7867 opened this issue May 7, 2024 · 1 comment
Labels
Component: CLI Type: Question Ask questions or seek assistance.

Comments

@aravinth-r-7867
Copy link

aravinth-r-7867 commented May 7, 2024

  • QUnit version: 2.20.1
  • Which environment are you using? (e.g., browser, Node): browser
  • How are you running QUnit? (e.g., QUnit CLI, Grunt, Karma, manually in browser): ember-qunit

We have a huge testsuite. Some testcases have been set assert.timeout option upto 3 to 5 minutes. We cannot remove this timeout option for now. Sometimes when any exception is thrown, tests are hanging for a long time (upto the timeout mentioned) before moving to the next testcase. We want to abort a test immediately if it throws any uncaught exception (not any test assertion failures) and proceed to next testcase. We couldn't able to find any option to do so. Is there any way to achieve this?

@aravinth-r-7867 aravinth-r-7867 closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
@Krinkle Krinkle reopened this Jul 9, 2024
@Krinkle
Copy link
Member

Krinkle commented Jul 9, 2024

I'm re-opening this as I think I can learn from your experience.

We currently catch and report uncaught errors as failures inside the currently-running test (when possible). It would indeed be possible to cancel a pending timeout based on that. However, this can't be a total cancellation I think, since that would expose the test suite to race conditions with undefined consequences.

For example, if the test function is an async function, we wait for the promise to resolve. When errors are thrown inside a promise chain, these already cause the test to automatically reject the async/promise and thus there is a fast failure, no timeout.

In your case, where is this uncaught exception is coming from? Knowing this can help me understand if there's a general solution we can come up with to address this. I don't think cancelling timeouts would be what we want to do here, but perhaps there's something else we can recommend/document/improve. But - for this I need to understand a bit more about where the error was thrown from in your case.

Thanks!

@Krinkle Krinkle added the Type: Question Ask questions or seek assistance. label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CLI Type: Question Ask questions or seek assistance.
Development

No branches or pull requests

2 participants