Skip to content

Commit d85a26d

Browse files
committed
Await the writing proc
1 parent 6647bfb commit d85a26d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

modal-js/test/sandbox_directory_mount.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ test("SandboxMountDirectoryWithImage", async () => {
2626
const sb1 = await tc.sandboxes.create(app, baseImage);
2727
onTestFinished(async () => await sb1.terminate());
2828

29-
await sb1.exec(["sh", "-c", "echo -n 'mounted content' > /tmp/test.txt"]);
29+
const echoProc = await sb1.exec([
30+
"sh",
31+
"-c",
32+
"echo -n 'mounted content' > /tmp/test.txt",
33+
]);
34+
await echoProc.wait();
3035

3136
const mountImage = await sb1.snapshotFilesystem();
3237
expect(mountImage.imageId).toMatch(/^im-/);
@@ -56,11 +61,12 @@ test("SandboxSnapshotDirectory", async () => {
5661
await (await sb1.exec(["mkdir", "-p", "/mnt/data"])).wait();
5762
await sb1.mountDirectory("/mnt/data");
5863

59-
await sb1.exec([
64+
const echoProc = await sb1.exec([
6065
"sh",
6166
"-c",
6267
"echo -n 'snapshot test content' > /mnt/data/snapshot.txt",
6368
]);
69+
await echoProc.wait();
6470

6571
const snapshotImage = await sb1.snapshotDirectory("/mnt/data");
6672
expect(snapshotImage.imageId).toMatch(/^im-/);

0 commit comments

Comments
 (0)