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
2 changes: 1 addition & 1 deletion packages/runtime-playground/src/mount-materialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async function prepareReadonlyDirectory(mount: MountSpec, mountIndex: number, so
await mkdir(cacheRoot, { recursive: true, mode: 0o700 })

let mode: ReadonlyMountPreparation["mode"] = "cache-hit"
await withPlaygroundArchiveCacheLock(cacheRoot, `readonly-mount-${generation.fingerprint}`, async () => {
await withPlaygroundArchiveCacheLock(cacheRoot, "readonly-mount-cache", async () => {
for (let attempt = 0; attempt < 2; attempt++) {
if (!await directoryExists(cachePath)) {
mode = "cache-miss"
Expand Down
10 changes: 10 additions & 0 deletions tests/playground-readonly-mounts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ try {
assert.ok((await Promise.all(concurrent.map(async (entry) => await readFile(join(entry.mounts[0].source, "value.txt"), "utf8") === "concurrent"))).every(Boolean), "concurrent snapshots are complete")
await Promise.all(concurrent.map((entry) => entry[Symbol.asyncDispose]()))

const parallelSources = await Promise.all(Array.from({ length: 12 }, async (_, index) => {
const source = join(root, `parallel-source-${index}`)
await mkdir(source)
await writeFile(join(source, "value.txt"), `parallel-${index}`)
return source
}))
const parallel = await stageReadonlyPlaygroundMounts(parallelSources.map((source, index) => ({ source, target: `/parallel-${index}`, mode: "readonly" })))
assert.ok((await Promise.all(parallel.mounts.map(async (mount, index) => await readFile(join(mount.source, "value.txt"), "utf8") === `parallel-${index}`))).every(Boolean), "parallel unique snapshots survive cache retention")
await parallel[Symbol.asyncDispose]()

const nestedParent = join(root, "nested-parent")
const nestedOverlay = join(root, "nested-overlay")
await mkdir(nestedParent)
Expand Down
Loading