[Bug] Flaky: app-quick-actions.registrar.spec "art activity lazy-loads the studio…" times out on a cold import #1178

Closed
opened 2026-10-02 08:46:00 +00:00 by spikerj · 1 comment
Owner

Bug

app-quick-actions.registrar.spec.ts › art activity lazy-loads the studio and toggles its panel, refreshing presence when it closes fails intermittently:

AssertionError: expected "vi.fn()" to be called 1 times, but got 0 times
  await vi.waitFor(() => expect(dialogOpen).toHaveBeenCalledTimes(1));

Same commit, different results: it failed twice standalone and under a full parallel run on 2026-10-02, then passed on rerun.

Cause

The registrar opens the panel via await import("@spikersoft/feature-art-studio"). The test waits with vi.waitFor, whose default timeout is 1 s. A cold load of the whole art-studio library is regularly slower than that on a loaded machine / CI runner.

Fix

Load the feature lib at the start of the test, so the registrar's own import() resolves from the module cache within the 1 s window. The real openArtActivityPanel still runs, so the panelClass assertion keeps testing real code; the cold load is covered by the config's 30 s testTimeout.

Acceptance criteria

  • spec passes repeatedly standalone and in the full app run

Found during the 2026-10-02 dependency-refresh ticket round; fixed in spikerj/spikersoft-angular#1424.

## Bug `app-quick-actions.registrar.spec.ts › art activity lazy-loads the studio and toggles its panel, refreshing presence when it closes` fails intermittently: ``` AssertionError: expected "vi.fn()" to be called 1 times, but got 0 times await vi.waitFor(() => expect(dialogOpen).toHaveBeenCalledTimes(1)); ``` Same commit, different results: it failed twice standalone and under a full parallel run on 2026-10-02, then passed on rerun. ## Cause The registrar opens the panel via `await import("@spikersoft/feature-art-studio")`. The test waits with `vi.waitFor`, whose default timeout is **1 s**. A cold load of the whole art-studio library is regularly slower than that on a loaded machine / CI runner. ## Fix Load the feature lib at the start of the test, so the registrar's own `import()` resolves from the module cache within the 1 s window. The real `openArtActivityPanel` still runs, so the `panelClass` assertion keeps testing real code; the cold load is covered by the config's 30 s `testTimeout`. ## Acceptance criteria - [ ] spec passes repeatedly standalone and in the full app run --- _Found during the 2026-10-02 dependency-refresh ticket round; fixed in spikerj/spikersoft-angular#1424._
spikerj added the bug label 2026-10-02 08:46:00 +00:00
Author
Owner

Tracker sweep 2026-10-06. Closing: fixed by spikerj/spikersoft-angular#1424 (merged 2026-10-02, commit 3865b8b71).

Gitea only auto-closes issues in the same repo, so this one stayed open. On angular master, app-quick-actions.registrar.spec.ts:246 runs await import("@spikersoft/feature-art-studio") before setup(...), with a comment explaining the cold-import race. That's the fix this issue describes.

I didn't re-run the spec repeatedly in this sweep. If it shows up flaky again in CI, please reopen with the run number.

**Tracker sweep 2026-10-06. Closing: fixed by spikerj/spikersoft-angular#1424 (merged 2026-10-02, commit 3865b8b71).** Gitea only auto-closes issues in the same repo, so this one stayed open. On angular `master`, `app-quick-actions.registrar.spec.ts:246` runs `await import("@spikersoft/feature-art-studio")` before `setup(...)`, with a comment explaining the cold-import race. That's the fix this issue describes. I didn't re-run the spec repeatedly in this sweep. If it shows up flaky again in CI, please reopen with the run number.
Sign in to join this conversation.