ruvnet/ruflo · error

Clock not installed. Call install() first.

Error message

Clock not installed. Call install() first.

What it means

The mock clock helper's tick() was called while the fake timers are not installed (install() was never called or uninstall() already ran). Ticking without vi.useFakeTimers would do nothing, so the helper throws to flag the setup omission.

Source

Thrown at v3/@claude-flow/testing/src/helpers/test-utils.ts:306

  let currentTime = Date.now();

  return {
    install() {
      if (installed) return;
      vi.useFakeTimers();
      vi.setSystemTime(currentTime);
      installed = true;
    },

    uninstall() {
      if (!installed) return;
      vi.useRealTimers();
      installed = false;
    },

    tick(ms: number) {
      if (!installed) {
        throw new Error('Clock not installed. Call install() first.');
      }
      currentTime += ms;
      vi.advanceTimersByTime(ms);
    },

    setTime(time: number | Date) {
      currentTime = typeof time === 'number' ? time : time.getTime();
      if (installed) {
        vi.setSystemTime(currentTime);
      }
    },

    getTime() {
      return currentTime;
    },

    runAllTimers() {
      if (!installed) {

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Call clock.install() before using fake timers.
  2. Ensure uninstall/restore ordering in teardown does not remove the clock early.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/@claude-flow/testing/src/helpers/test-utils.ts:306 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/a404c634aaf03ccc. Report an issue: GitHub.