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

Open
opened 2026-10-02 08:46:00 +00:00 by spikerj · 0 comments
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
Sign in to join this conversation.