Skip to content

Commit f0f88f4

Browse files
committed
set global timeout
1 parent bc51527 commit f0f88f4

File tree

7 files changed

+20
-12
lines changed

7 files changed

+20
-12
lines changed

packages/hub/src/lib/list-files.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe("listFiles", () => {
6060
type: "file",
6161
},
6262
]);
63-
}, 30_000);
63+
});
6464

6565
it("should fetch the list of files from the repo, including last commit", async () => {
6666
const cursor = listFiles({
@@ -146,7 +146,7 @@ describe("listFiles", () => {
146146
type: "file",
147147
},
148148
]);
149-
}, 30_000);
149+
});
150150

151151
it("should fetch the list of files from the repo, including subfolders", async () => {
152152
const cursor = listFiles({
@@ -165,5 +165,5 @@ describe("listFiles", () => {
165165
}
166166

167167
assert(files.some((file) => file.path === "data/XSUM-EMNLP18-Summary-Data-Original.tar.gz"));
168-
}, 30_000);
168+
});
169169
});

packages/hub/src/lib/parse-safetensors-metadata.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe("parseSafetensorsMetadata", () => {
4949
assert.deepStrictEqual(parse.parameterCount, { BF16: 176_247_271_424 });
5050
assert.deepStrictEqual(sum(Object.values(parse.parameterCount)), 176_247_271_424);
5151
// total params = 176B
52-
}, 30_000);
52+
});
5353

5454
it("fetch info for single-file with multiple dtypes", async () => {
5555
const parse = await parseSafetensorsMetadata({

packages/hub/src/lib/upload-file.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,5 @@ describe("uploadFile", () => {
9494
hubUrl: TEST_HUB_URL,
9595
});
9696
}
97-
}, 30_000);
97+
});
9898
});

packages/hub/src/utils/WebBlob.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe("WebBlob", () => {
5858
expect(webBlob).toBeInstanceOf(WebBlob);
5959
expect(webBlob).toMatchObject({ url });
6060
expect(await webBlob.slice(10, 22).text()).toBe("__metadata__");
61-
}, 30_000);
61+
});
6262

6363
it("should lazy load a Xet file hosted on Hugging Face", async () => {
6464
const stableDiffusionUrl =
@@ -70,7 +70,7 @@ describe("WebBlob", () => {
7070
expect(webBlob).toBeInstanceOf(WebBlob);
7171
expect(webBlob).toMatchObject({ url });
7272
expect(await webBlob.slice(10, 22).text()).toBe("__metadata__");
73-
}, 30_000);
73+
});
7474

7575
it("should create a slice on the file", async () => {
7676
const expectedText = fullText.slice(10, 20);

packages/hub/src/utils/XetBlob.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe("XetBlob", () => {
1313
});
1414

1515
expect(await blob.slice(10, 22).text()).toBe("__metadata__");
16-
}, 30_000);
16+
});
1717

1818
it("should load the first chunk correctly", async () => {
1919
let xorbCount = 0;
@@ -44,7 +44,7 @@ describe("XetBlob", () => {
4444

4545
expect(new Uint8Array(xetDownload)).toEqual(new Uint8Array(bridgeDownload));
4646
expect(xorbCount).toBe(1);
47-
}, 30_000);
47+
});
4848

4949
it("should load just past the first chunk correctly", async () => {
5050
let xorbCount = 0;
@@ -135,9 +135,9 @@ describe("XetBlob", () => {
135135
console.log("xet", xetDownload.byteLength, "bridge", bridgeDownload.byteLength);
136136
expect(new Uint8Array(xetDownload).length).toEqual(100_000);
137137
expect(new Uint8Array(xetDownload)).toEqual(new Uint8Array(bridgeDownload));
138-
}, 30_000);
138+
});
139139

140-
it.only("should load text correctly when offset_into_range starts in a chunk further than the first", async () => {
140+
it("should load text correctly when offset_into_range starts in a chunk further than the first", async () => {
141141
const blob = new XetBlob({
142142
repo: {
143143
type: "model",
@@ -185,7 +185,7 @@ describe("XetBlob", () => {
185185

186186
console.log("xet", text.length, "bridge", bridgeDownload.length);
187187
expect(text.length).toBe(bridgeDownload.length);
188-
}, 30_000);
188+
});
189189

190190
describe("bg4_regoup_bytes", () => {
191191
it("should regroup bytes when the array is %4 length", () => {

packages/hub/vitest-browser.config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { configDefaults, defineConfig } from "vitest/config";
22

33
export default defineConfig({
44
test: {
5+
testTimeout: 30_000,
56
exclude: [
67
...configDefaults.exclude,
78
"src/utils/FileBlob.spec.ts",

packages/hub/vitest.config.mts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from "vitest/config";
2+
3+
export default defineConfig({
4+
test: {
5+
testTimeout: 30_000,
6+
},
7+
});

0 commit comments

Comments
 (0)