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

API Status workflow occasionally hangs and times out #26

Closed
JstnMcBrd opened this issue Dec 21, 2023 · 2 comments · Fixed by #27 or #41
Closed

API Status workflow occasionally hangs and times out #26

JstnMcBrd opened this issue Dec 21, 2023 · 2 comments · Fixed by #27 or #41
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@JstnMcBrd
Copy link
Owner

JstnMcBrd commented Dec 21, 2023

About once every week or two, the API Status action will fail because vitest fails to terminate after running api.test.ts. The test passes successfully, but vitest does not exit, so the workflow eventually times out with an error after 6 hours. This causes the badge in the README to say "API Status: Failing".

Here is an example run.

Run npm run test-api

> delphi-ai@2.0.0 test-api
> vitest api

 RUN  v1.0.1 /home/runner/work/delphi-ai/delphi-ai

 ✓ test/api.test.ts  (1 test) 657ms

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  00:38:52
   Duration  11.03s (transform 41ms, setup 0ms, collect 29ms, tests 657ms, environment 0ms, prepare 71ms)

close timed out after 10000ms
Failed to terminate worker while running /home/runner/work/delphi-ai/delphi-ai/test/api.test.ts.
Tests closed successfully but something prevents Vite server from exiting
You can try to identify the cause by enabling "hanging-process" reporter. See https://vitest.dev/config/#reporters
Error: The operation was canceled.

After some digging, I found this comment in vitest#2008, which suggested that node's fetch API is the culprit. Tests that use node's fetch or undici will occasionally hang. The root issue is nodejs/undici#2026.

This is currently being investigated, so while I wait for the issue to be fixed, my only workaround is to simply re-run the workflows when they fail.

Duplicate issue with JstnMcBrd/dectalk-tts#9

@JstnMcBrd JstnMcBrd added bug Something isn't working wontfix This will not be worked on labels Dec 21, 2023
@JstnMcBrd JstnMcBrd assigned JstnMcBrd and unassigned JstnMcBrd Dec 21, 2023
@JstnMcBrd
Copy link
Owner Author

JstnMcBrd commented Mar 22, 2024

This issue will (probably) be fixed in vitest v2, as per vitest-dev/vitest#2008 (comment). Waiting on vitest-dev/vitest#5047 to be merged.

Once that update is released, the --pool=forks workaround can be removed.

@JstnMcBrd
Copy link
Owner Author

Vitest 2 has been released, and I have updated to it and removed the --pool=forks option. This issue should be completely resolved now. I will reopen this issue if the workflow begins hanging and timing out again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
1 participant