Skip to content

[Bug]: Flaky behaviour on stopTime #33926

@vvargas90

Description

@vvargas90

Version

1.46.1

Steps to reproduce

  1. Call this func to stop time:
export async function stopTime(page) {
    await page.clock.install();
    await page.clock.pauseAt(Date.now());
}

Expected behavior

Time is stopped at current time

Actual behavior

Sometimes I have this error:

Error: clock.pauseAt: Error: Cannot fast-forward to the past

    at ClockController._innerFastForwardTo (<anonymous>:164:13)
    at ClockController.pauseAt (<anonymous>:116:16)
    at eval (eval at evaluate (:234:30), <anonymous>:1:33)
    at eval (<anonymous>)
    at UtilityScript.evaluate (<anonymous>:234:30)
    at UtilityScript.<anonymous> (<anonymous>:1:44)
    at ClockController._innerFastForwardTo (/app/<anonymous>:164:13)
    at ClockController.pauseAt (/app/<anonymous>:116:16)
    at eval (/app/eval at evaluate (:234:30), <anonymous>:1:33)
    at UtilityScript.evaluate (/app/<anonymous>:234:30)
    at UtilityScript.<anonymous> (/app/<anonymous>:1:44)
    at stopTime (/app/uitests/utils/playwrightClock.ts:11:22)
    at /app/uitests/tests/mytest.spec.ts:213:13

Additional context

No response

Environment

System:
    OS: macOS 13.5
    CPU: (8) arm64 Apple M2
    Memory: 98.86 MB / 16.00 GB
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: 1.46.1 => 1.46.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions