You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-06-26] Investigate workflow job failing on main: test / test (job 8) #93787
🐛 Error Message:
warning: [git-mirror] Skipping cache commit: Found 2 failed/cancelled steps
warning: [git-mirror] - Step: unknown (failed)
failure: Process completed with exit code 1.
⚠️Action Required⚠️:
🛠️ A recent merge appears to have caused a failure in the job named test / test (job 8).
🔍 This issue has been automatically created and labeled with Workflow Failure for investigation.
● ConciergeDraftContext › does not apply completed final HTML until the paced Pusher target is fully visible
expect(received).toBe(expected) // Object.is equality
Expected: "He"
Received: "Hel"
182 |
183 | // Then final HTML waits until the banked text is visible
> 184 | expect(getFirstMessageText(result.current.draftReportAction)).toBe('He');
| ^
185 | expect(getFirstMessageText(result.current.draftReportAction)).not.toBe('Server final response');
186 | expect(result.current.isDraftPendingCompletion).toBe(true);
187 |
at Object.toBe (tests/unit/pages/inbox/ConciergeDraftContext.test.tsx:184:71)
at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:17)
at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:17:9)
The first emitPusherEvent (CONCIERGE_DRAFT_UPDATED) calls startPusherDraftPace, stamping lastPaceTickTimeRef = Date.now() (line 329). The second emitPusherEvent (CONCIERGE_DRAFT_COMPLETED) synchronously runs tickPacing once. If < 10ms of real time passed between the two act() blocks, unitsToReveal = 1 and exactly one extra char is revealed → 'He' (the expectation). On a slow runner ≥ 20ms passes → unitsToReveal ≥ 2 → 'Hel' — the observed Expected "He" / Received "Hel".
The two sibling tests that exercise the same elapsed-time path are deterministic precisely because they mock Date.now (e.g. line 193). This one doesn't.
Recommended Fix: Make the test deterministic by mocking Date.now and advancing it by exactly one pace interval between the two events (mirroring the sibling tests). Production code is correct and needs no change.
Suggested patch
it('does not apply completed final HTML until the paced Pusher target is fully visible',async()=>{letnow=1000;jest.spyOn(Date,'now').mockImplementation(()=>now);constwrapper=({children}: PropsWithChildren)=><ConciergeDraftProviderreportID={REPORT_ID}>{children}</ConciergeDraftProvider>;const{result, unmount}=renderHook(()=>useConciergeDraft(),{wrapper});awaitwaitFor(()=>{expect(Pusher.subscribe).toHaveBeenCalledTimes(6);});// Given an active paced Pusher targetact(()=>{emitPusherEvent(Pusher.TYPE.CONCIERGE_DRAFT_UPDATED,createDraftEvent(TARGET_BODY_MARKDOWN));});expect(getFirstMessageText(result.current.draftReportAction)).toBe('H');// When completion arrives one pace tick later, before the visible body reaches the targetnow+=PUSHER_DRAFT_PACE_INTERVAL_MS;act(()=>{emitPusherEvent(Pusher.TYPE.CONCIERGE_DRAFT_COMPLETED,createDraftEvent('',{sequence: 2,status: 'completed',bodyMarkdown: undefined,finalRenderedHTML: FINAL_RENDERED_HTML,}),);});// Then final HTML waits until the banked text is visibleexpect(getFirstMessageText(result.current.draftReportAction)).toBe('He');expect(getFirstMessageText(result.current.draftReportAction)).not.toBe('Server final response');expect(result.current.isDraftPendingCompletion).toBe(true);unmount();});
With Date.now fixed and advanced by exactly PUSHER_DRAFT_PACE_INTERVAL_MS, elapsedIntervals === 1 → unitsToReveal === 1 → exactly one extra char is revealed ('He'), regardless of how loaded the CI runner is. jest.restoreAllMocks() in the existing afterEach already cleans up the spy.
Why it's the test and not the feature
The production reveal rate is intentionally time-driven (a typing animation), so on real machines drift of a few ms is invisible. The bug only manifests because the test asserts an exact character count tied to real elapsed time.
No production code path changed behavior; the failure is purely a function of CI scheduling jitter between two synchronous act() calls.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/93787) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Investigate workflow job failing on main: test / test (job 8)[/-][+][Due for payment 2026-06-26] Investigate workflow job failing on main: test / test (job 8)[/+]on Jun 19, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.15-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
Activity
MariaHCD commentedon Jun 17, 2026
@MelvinBot investigate
MelvinBot commentedon Jun 17, 2026
Issue Analysis
Root Cause: Flaky test, not a product bug. The test
ConciergeDraftContext.test.tsx› does not apply completed final HTML until the paced Pusher target is fully visible relies on real wall-clock time to control how many characters the pacer reveals, so it fails on a slow/loaded CI runner.The pacer reveals one character per
PUSHER_DRAFT_PACE_INTERVAL_MS(10ms) of elapsed real time —usePusherDraftPacing.ts:236-239:The first
emitPusherEvent(CONCIERGE_DRAFT_UPDATED) callsstartPusherDraftPace, stampinglastPaceTickTimeRef = Date.now()(line 329). The secondemitPusherEvent(CONCIERGE_DRAFT_COMPLETED) synchronously runstickPacingonce. If < 10ms of real time passed between the twoact()blocks,unitsToReveal = 1and exactly one extra char is revealed →'He'(the expectation). On a slow runner ≥ 20ms passes →unitsToReveal ≥ 2→'Hel'— the observedExpected "He" / Received "Hel".The two sibling tests that exercise the same elapsed-time path are deterministic precisely because they mock
Date.now(e.g. line 193). This one doesn't.Recommended Fix: Make the test deterministic by mocking
Date.nowand advancing it by exactly one pace interval between the two events (mirroring the sibling tests). Production code is correct and needs no change.Suggested patch
With
Date.nowfixed and advanced by exactlyPUSHER_DRAFT_PACE_INTERVAL_MS,elapsedIntervals === 1→unitsToReveal === 1→ exactly one extra char is revealed ('He'), regardless of how loaded the CI runner is.jest.restoreAllMocks()in the existingafterEachalready cleans up the spy.Why it's the test and not the feature
act()calls.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/93787)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
MariaHCD commentedon Jun 17, 2026
Okay, rerunning led to this job passing so it is a flakey test indeed: https://github.com/Expensify/App/actions/runs/27680952560
@inimaga I believe you introduced this test? Could you please look into and resolve it's flakiness?
[-]Investigate workflow job failing on main: test / test (job 8)[/-][+][Due for payment 2026-06-26] Investigate workflow job failing on main: test / test (job 8)[/+]melvin-bot commentedon Jun 19, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 19, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.15-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-06-26. 🎊
inimaga commentedon Jun 19, 2026
No checklist due.