Skip to content

Figure out why a browser test doesn't work in CI #1286

Closed
@coyotte508

Description

@coyotte508

// In github actions, this test doesn't work inside the browser, but it works locally
// inside both chrome and chromium browsers
// TODO: figure out why
if (typeof window === "undefined") {
it("should load correctly when loading far into a chunk range", async () => {
const blob = new XetBlob({
repo: {
type: "model",
name: "celinah/xet-experiments",
},
hash: "7b3b6d07673a88cf467e67c1f7edef1a8c268cbf66e9dd9b0366322d4ab56d9b",
size: 5_234_139_343,
});
const xetDownload = await blob.slice(10_000_000, 10_100_000).arrayBuffer();
const bridgeDownload = await fetch(
"https://huggingface.co/celinah/xet-experiments/resolve/main/model5GB.safetensors",
{
headers: {
Range: "bytes=10000000-10099999",
},
}
).then((res) => res.arrayBuffer());
console.log("xet", xetDownload.byteLength, "bridge", bridgeDownload.byteLength);
expect(new Uint8Array(xetDownload)).toEqual(new Uint8Array(bridgeDownload));
}, 30_000);
}

This test doesn't work in the CI.

After publishing , we can at least check it works in browsers (by importing `__internal_XetBlob

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions