From fa21a7a458f131814dabf747c802fea5ccca2580 Mon Sep 17 00:00:00 2001 From: LukeGus Date: Sat, 3 Oct 2026 15:59:46 -0500 Subject: [PATCH] test: compare download stream buffers directly so it stops timing out --- .../file-manager/tests/backend/download-stream.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/file-manager/tests/backend/download-stream.test.ts b/plugins/file-manager/tests/backend/download-stream.test.ts index 6aa694431..f44456539 100644 --- a/plugins/file-manager/tests/backend/download-stream.test.ts +++ b/plugins/file-manager/tests/backend/download-stream.test.ts @@ -58,9 +58,13 @@ describe("SFTP download stream", () => { const data = Buffer.alloc(1024 * 1024 + 123); for (let i = 0; i < data.length; i++) data[i] = (i * 13 + (i >>> 8)) % 256; const remote = source(data); - expect( - await contents(createDownloadStream(remote.sftp, "/file", data.length)), - ).toEqual(data); + const received = await contents( + createDownloadStream(remote.sftp, "/file", data.length), + ); + // toEqual walks a 1 MB buffer byte by byte, slow enough to time out + // when every plugin suite runs at once. + expect(received.length).toBe(data.length); + expect(received.equals(data)).toBe(true); expect(remote.peak()).toBe(8); expect(remote.closedWithPending).toEqual([0]); });