Skip to content

Commit f8ce008

Browse files
committed
test(desktop): draw the run nonce from the shared random helpers, and keep the lease constant private
1 parent 2007048 commit f8ce008

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/desktop/e2e/executor-sim.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818

1919
const DESKTOP_DIR = fileURLToPath(new URL('..', import.meta.url))
2020
export const WORKSPACE = 'ws-e2e'
21-
export const LEASE_RENEW_MS = 1_000
21+
const LEASE_RENEW_MS = 1_000
2222
export const RECONCILE_MS = 2_000
2323

2424
type CallStatus = 'pending' | 'awaiting_approval' | 'running' | 'completed' | 'failed' | 'cancelled'

‎apps/desktop/e2e/terminal-cancel.spec.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { join } from 'node:path'
55
import { type ElectronApplication, expect, type Page, test } from '@playwright/test'
66
import type { SimDesktopApi } from '@sim/desktop-bridge'
77
import { sleep } from '@sim/utils/helpers'
8+
import { randomInt } from '@sim/utils/random'
89
import { FixtureSim, launch, processRunning, registeredDevice, settled } from './executor-sim'
910

1011
/**
@@ -53,7 +54,7 @@ const REAL_TMUX = findTmux()
5354
* Unique to this run of the suite, so its processes are never confused with those of another run on
5455
* the same machine (CI boxes run several at once).
5556
*/
56-
const RUN_NONCE = String(Math.floor(Math.random() * 1_000_000)).padStart(6, '0')
57+
const RUN_NONCE = String(randomInt(0, 1_000_000)).padStart(6, '0')
5758

5859
/** A sleep that runs for about `seconds` and that only this test names. */
5960
function slept(seconds: number): string {

0 commit comments

Comments
 (0)