Project: findDocuments-api · Branch: FHIR-2020-implement-hl-findDocuments-api · Mode: ` · **Model:**claude-sonnet-4-6`
Stats: 1 user messages, 11 tool calls, tools used: Bash.
Conversation
Turn 1 — User
Get the detailed failure output for GitHub Actions run 22177400277, specifically the "Frontend tests / Frontend tests packages (2)" job.
First get the job ID: gh run view 22177400277 --json jobs -q '.jobs[] | select(.name | contains("Frontend tests packages (2)")) | {id: .databaseId, name: .name, conclusion: .conclusion}'
Then get the logs for that job: gh run view 22177400277 --log-failed 2>&1 | grep -A 30 "FAIL|Cannot log|AbortError|DmpSharing|console.error" | head -100
Return the full error output so I can diagnose the issue.
Turn 1 — Assistant
I'll run both commands in parallel to get the job details and failure logs.
Tools used:
Bash:gh run view 22177400277 --json jobs -q '.jobs[] | select(.name | contains("Frontend tests packages (2)")) | {id: .databaseId, name: .name, conclusion: .conclusion}'
Tool results:
→ result (ok): {"conclusion":"failure","id":64129659827,"name":"Frontend tests / Frontend tests packages (2)"}
Tools used:
Bash:gh run view 22177400277 --log-failed 2>&1 | grep -A 30 "FAIL\|Cannot log\|AbortError\|DmpSharing\|console.error" | head -100
Tool results:
→ result (ok): Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:11:07.6396448Z TEST_FAILURES_INTERNAL_URL: http://internal-a1c5cb828fc3a40cba034e11e03b9025-771546586.eu-west-1.elb.amazonaws.com:3000 Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:11:07.6397137Z TEST_FAILURES_INTERNAL_URL_STAGING: http://internal-a212ea39062164f938eff7d152b422d8-43844912.eu-west-1.elb.amazonaws.com:3000 Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:11: …(truncated, 12524 more chars)
The grep output is showing mostly environment variable setup. Let me get the actual test failure content with a more targeted query.
Tools used:
Bash:gh run view 22177400277 --log-failed 2>&1 | grep -E "● |FAIL |Error:|TypeError:|expect\(|●" | head -80
Tool results:
→ result (ok): Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:12:45.3943353Z [36;1m >&2 echo "Error: Neither wget nor curl is installed."[0m Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:12:45.3955189Z [36;1m >&2 echo "Error: Neither sha256sum nor shasum is installed."[0m Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:30.1922784Z [1m● [22mConsole Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:30 …(truncated, 15894 more chars)
Now let me get more specific context: the test file names, the actual assertion failures, and what's around the "Cannot log after tests" errors.
Tools used:
Bash:gh run view 22177400277 --log-failed 2>&1 | grep -E "\.test\.(ts|tsx|js)|FAIL packages|Attempt|Logging was last" | head -60
Tool results:
→ result (ok): Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:21.8292602Z [0m[7m[1m[32m PASS [39m[22m[27m[0m [0m[7m[37m @doctolib/xdt_reader_writer [39m[27m[0m [2msrc/kbv-field-types/[22m[1mKbvBirthdate.test.ts[22m Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:21.8294555Z [0m[7m[1m[32m PASS [39m[22m[27m[0m [0m[7m[37m @doctolib/xdt_reader_writer [39m[27m[0m [2msrc/kbv-field-types/[22m[1mKbvDateRange.test.ts[22m Frontend …(truncated, 11412 more chars)
Tools used:
Bash:gh run view 22177400277 --log-failed 2>&1 | grep -E "FAIL packages|Tests Suites|Test Suites:|Tests:|Snapshots:|Time:|Ran all" | head -30
Tool results:
→ result (ok): Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:09.6122187Z [1mTest Suites: [22m[1m[32m1 passed[39m[22m, 1 total Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:09.6123303Z [1mTests: [22m[1m[32m28 passed[39m[22m, 28 total Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:09.6124860Z [1mSnapshots: [22m0 total Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:09.6125754Z [ …(truncated, 3461 more chars)
Tools used:
Bash:gh run view 22177400277 --log-failed 2>&1 | grep -E "failed|FAIL " | head -40
Tool results:
→ result (ok): Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:50.3080886Z npm error Lifecycle script test:unit failed with error:
Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:50.3083421Z npm error command failed
Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:57.3443193Z [31mERROR[0m [31mfailed to read input source map: failed to find input source map file "print.map" in "/opt/actions-runner/_work/doctolib/doctolib/app
…(truncated, 4990 more chars)
Tools used:
Bash:gh run view 22177400277 --log-failed 2>&1 | grep -E "Test Suites:.*failed|Tests:.*failed" | head -20
Tool results:
→ result (ok)
Tools used:
Bash:gh run view 22177400277 --log-failed 2>&1 | grep -B2 -A5 "npm error Lifecycle script" | head -40
Tool results:
→ result (ok): Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:50.3079162Z [33m[1m[22m[39m
Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:50.3080346Z [33m[1m'[22m[39m[33mThis usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with --detectOpenHandles to troubleshoot this issue.[39m
Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:50.3080886Z npm error Lifecycl
…(truncated, 725 more chars)
Tools used:
Bash:gh run view 22177400277 --log-failed 2>&1 | grep -B5 "DmpSharing\|dmp\|DMP" | grep -v "UNKNOWN STEP.*2026-02-19T10:1[01]" | head -60
Tool results:
→ result (ok): --
-- Frontend tests / Frontend tests packages (2) UNKNOWN STEP ./packages/@doctolib/de_billing_entries/node_modules Frontend tests / Frontend tests packages (2) UNKNOWN STEP ./packages/@doctolib/doctor_appointment_booking_sdk/node_modules Frontend tests / Frontend tests packages (2) UNKNOWN STEP ./packages/@doctolib/cost-bearer-plan/node_modules Frontend tests / Frontend tests packages (2) UNKNOWN STEP ./packages/@doctolib/hcp_segmentation_sdk/node_modules Frontend tests / Frontend tests pac …(truncated, 4991 more chars)
Tools used:
Bash:gh run view 22177400277 --log-failed 2>&1 | grep -E "10:13:4[0-9]|10:13:50" | head -80
Tool results:
→ result (ok): Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:48.2567774Z ##[endgroup] Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:48.2572805Z ##[group]✅ > nx run @doctolib/financial_os_session:"test:unit" --runInBand --bail=0 --ci --reporters=jest-reporter-junit-with-flaky --reporters=summary Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:13:48.2576388Z Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:1 …(truncated, 14615 more chars)
Now I have the full picture. Let me get the final summary of which NX projects failed:
Tools used:
Bash:gh run view 22177400277 --log-failed 2>&1 | grep -E "NX.*failed|Running target test|projects failed" | head -20
Tool results:
→ result (ok): Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:12:56.2611626Z NX Running target test:unit for 90 projects: Frontend tests / Frontend tests packages (2) UNKNOWN STEP 2026-02-19T10:20:14.2912343Z NX Running target test:unit for 90 projects failed
Here is the complete diagnosis of the failure:
Job: Frontend tests / Frontend tests packages (2)
Job ID: 64129659827 Conclusion: failure
Root Cause: @doctolib/dmp package test suite failure
The failure is in packages/@doctolib/dmp, specifically in the test file:
src/hooks/tests/DmpSharingService.test.ts (32.645 s)
The test file itself reports PASS, but it causes Jest to fail with "Cannot log after tests are done" errors. This means the test has unresolved async operations (in-flight fetch requests) that outlive the test suite teardown.
Error Detail
● Cannot log after tests are done. Did you forget to wait for something async in your test?
Attempted to log "DOMException [AbortError]: The operation was aborted.
at Fetch.onAsyncTaskManagerAbort (happy-dom/src/fetch/Fetch.ts:710:17)
at happy-dom/src/fetch/Fetch.ts:544:10
at AsyncTaskManager.abortAll (happy-dom/src/async-task-manager/AsyncTaskManager.ts:331:21)
at AsyncTaskManager.abort (happy-dom/src/async-task-manager/AsyncTaskManager.ts:61:15)
at DetachedBrowserFrame.abort (happy-dom/src/browser/detached-browser/DetachedBrowserFrame.ts:139:49)
at DetachedWindowAPI.abort (happy-dom/src/window/DetachedWindowAPI.ts:62:29)
at DatadogEnvironment.teardown (@happy-dom/jest-environment/src/index.ts:152:51)
at DatadogEnvironment.teardown (dd-trace/.../jest.js:793:20)
at tearDownEnv (jest-runner/build/runTest.js:286:25)
at runTestInternal (jest-runner/build/runTest.js:420:11)
at runTest (jest-runner/build/runTest.js:444:34)"
This error fires dozens of times (one per in-flight fetch request that was still pending when the test environment tore down).
What's Happening
DmpSharingService.test.tsmakes real (or mocked)fetchcalls that are not awaited/cancelled before the test ends.- When
happy-dom'sDetachedWindowAPI.abort()is called during Jest teardown, it kills those pending fetches, producingAbortErrorexceptions. - Those
AbortErrors try toconsole.error, but Jest's buffered console has already been flushed — triggering the "Cannot log after tests are done" fatal error. - Jest treats this as a test failure and exits with code 1.
- NX reports the overall run for 90 projects as failed.
npm error summary
npm error Lifecycle script `test:unit` failed with error:
npm error code 1
npm error path /opt/.../packages/@doctolib/dmp
npm error workspace @doctolib/<REDACTED>
npm error command failed
Jest also advises:
"This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with
--detectOpenHandlesto troubleshoot this issue."
How to fix
In packages/@doctolib/dmp/src/hooks/tests/DmpSharingService.test.ts, the tests need to ensure all pending fetch requests are properly cancelled or awaited before the test completes. Common fixes:
- Add
afterEach(() => { /* cancel/abort any pending requests */ })cleanup. - Use
jest.fakeTimers()andjest.runAllTimers()to flush pending async work. - Await all promises before test assertions complete.
- If using React Query or similar, call
queryClient.clear()andqueryClient.cancelQueries()inafterEach.