Skip to content

Commit 732ee72

Browse files
committed
btrfs: add sync command in hopes of getting tests to pass on gitub CI
1 parent a7a0d95 commit 732ee72

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/packages/file-server/btrfs/filesystem.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ export class Filesystem {
7171
await this.initBup();
7272
};
7373

74+
sync = async () => {
75+
await btrfs({ args: ["filesystem", "sync", this.opts.mount] });
76+
};
77+
7478
unmount = async () => {
7579
await sudo({
7680
command: "umount",

src/packages/file-server/btrfs/test/filesystem-stress.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ describe("stress operations with subvolumes", () => {
4848
});
4949

5050
it("clone the first group in serial", async () => {
51+
await fs.sync(); // needed on github actions
5152
const t = Date.now();
5253
for (let i = 0; i < count1; i++) {
5354
await fs.subvolumes.clone(`${i}`, `clone-of-${i}`);
@@ -58,6 +59,7 @@ describe("stress operations with subvolumes", () => {
5859
});
5960

6061
it("clone the second group in parallel", async () => {
62+
await fs.sync(); // needed on github actions
6163
const t = Date.now();
6264
const v: any[] = [];
6365
for (let i = 0; i < count2; i++) {
@@ -90,6 +92,12 @@ describe("stress operations with subvolumes", () => {
9092
`deleted ${Math.round((count2 / (Date.now() - t)) * 1000)} subvolumes per second in parallel`,
9193
);
9294
});
95+
96+
it("everything should be gone except the clones", async () => {
97+
await fs.sync();
98+
const v = await fs.subvolumes.list();
99+
expect(v.length).toBe(count1 + count2);
100+
});
93101
});
94102

95103
afterAll(after);

src/packages/file-server/conat/test/local-path.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ describe("use the simple fileserver", () => {
9999
const stats0 = await fs.stat("source1");
100100
expect(stats0.isSymbolicLink()).toBe(false);
101101
});
102+
103+
102104

103105
it("closes the service", () => {
104106
server.close();

0 commit comments

Comments
 (0)