Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/scripts/run-agent-task/execute-native-agent-task.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { constants, rmSync } from "node:fs"
import { appendFile, lstat, mkdir, open, readFile, realpath, rm, writeFile } from "node:fs/promises"
import { appendFile, lstat, mkdir, open, readFile, realpath, rename, rm, writeFile } from "node:fs/promises"
import { isUtf8 } from "node:buffer"
import { isAbsolute, join, relative, resolve } from "node:path"
import { pathToFileURL } from "node:url"
Expand Down Expand Up @@ -523,7 +523,9 @@ async function testPauseAfterSeedSnapshot(seedSnapshot) {
if (process.env.NODE_ENV !== "test") return
const markerPath = string(process.env.WP_CODEBOX_TEST_SEED_SNAPSHOT_PAUSE_FILE)
if (!markerPath) return
await writeFile(markerPath, `${JSON.stringify({ schema: "wp-codebox/test-seed-snapshot-pause/v1", seed_snapshot_source: seedSnapshot?.source ?? "" })}\n`)
const pendingMarkerPath = `${markerPath}.${process.pid}.tmp`
await writeFile(pendingMarkerPath, `${JSON.stringify({ schema: "wp-codebox/test-seed-snapshot-pause/v1", seed_snapshot_source: seedSnapshot?.source ?? "" })}\n`)
await rename(pendingMarkerPath, markerPath)
await new Promise((resolvePause) => setTimeout(resolvePause, 120_000))
}

Expand Down
6 changes: 4 additions & 2 deletions tests/fixtures/playground-cache-lease-child.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { lstat, writeFile } from "node:fs/promises"
import { lstat, rename, writeFile } from "node:fs/promises"

import { acquirePlaygroundArchiveReference } from "../../packages/runtime-playground/src/playground-wordpress-archive-cache.js"

Expand All @@ -8,7 +8,9 @@ if (!archivePath || !readyPath || !stopPath) {
}

const reference = await acquirePlaygroundArchiveReference(archivePath)
await writeFile(readyPath, reference.path)
const pendingReadyPath = `${readyPath}.${process.pid}.tmp`
await writeFile(pendingReadyPath, reference.path)
await rename(pendingReadyPath, readyPath)

while (!await exists(stopPath)) {
await new Promise((resolve) => setTimeout(resolve, 25))
Expand Down
Loading