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

Flaky test? #403

Open
kikuomax opened this issue Jan 16, 2025 · 4 comments
Open

Flaky test? #403

kikuomax opened this issue Jan 16, 2025 · 4 comments
Labels
internal Related to internal feature need investigation Need investigation
Milestone

Comments

@kikuomax
Copy link
Collaborator

kikuomax commented Jan 16, 2025

Overview of the problem

Buefy version: [0.2.0]
Vuejs version: [3.3.10]
OS/Browser: macOS/Vitest

Description

A GitHub Actions job for verification (verify.yml) failed with the following error:

⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯

⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯
ReferenceError: window is not defined

 ❯ Proxy.<anonymous> src/components/autocomplete/Autocomplete.vue:607:37
Vitest caught 1 unhandled error during the test run.
    605| 
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
    606|                 this.isListInViewportVertically = rect.top >= 0 &&
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
    607|                     rect.bottom <= (window.innerHeight || document.doc…
 Test Files  80 passed (80)
       |                                     ^
    608|                 if (this.appendToBody) {
    609|                     this.updateAppendToBody()

This error originated in "src/components/autocomplete/Autocomplete.spec.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
This error was caught after test environment was torn down. Make sure to cancel any running tasks before test finishes:
- cancel timeouts using clearTimeout and clearInterval
- wait for promises to resolve using the await keyword

This should not be a problem of the library itself.

Steps to reproduce

Difficult to reproduce; when I re-ran the tests, it did not happen. Run unit tests repeatedly until you face it.

Expected behavior

Any unhandled rejection error should not happen.

Actual behavior

An unhandled rejection error happened.

@kikuomax kikuomax added need investigation Need investigation internal Related to internal feature labels Jan 16, 2025
@kikuomax
Copy link
Collaborator Author

It happened again!

@wesdevpro
Copy link

wesdevpro commented Jan 17, 2025

What branch were you on? Dev?

I was looking through that pipeline's logs and can't find the error being logged

@kikuomax
Copy link
Collaborator Author

What branch were you on? Dev?

I was looking through that pipeline's logs and can't find the error being logged

@wesdevpro On dev, but I reran the failed jobs, and they passed. That's why you could not find the error.

@wesdevpro
Copy link

wesdevpro commented Jan 17, 2025 via email

@wesdevpro wesdevpro added this to the v0.2.1 milestone Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Related to internal feature need investigation Need investigation
Projects
None yet
Development

No branches or pull requests

2 participants