Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
cirospaciari committed Dec 28, 2024
1 parent cc5b3c0 commit e788166
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/js/bun/s3/s3-stream-leak-fixture.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions test/js/bun/s3/s3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,37 @@ describe.skipIf(!s3Options.accessKeyId)("s3", () => {
});

describe("leak tests", () => {
it(
"fsFile.stream() should not leak",
async () => {
const dir = tempDirWithFiles("bun-write-leak-fixture", {
"s3-stream-leak-fixture.js": await Bun.file(path.join(import.meta.dir, "s3-stream-leak-fixture.js")).text(),
"out.bin": "here",
});

const dest = path.join(dir, "out.bin");

const { exitCode, stderr } = Bun.spawnSync(
[bunExe(), "--smol", path.join(dir, "s3-stream-leak-fixture.js"), dest],
{
env: {
...bunEnv,
BUN_JSC_gcMaxHeapSize: "503316",
AWS_ACCESS_KEY_ID: s3Options.accessKeyId,
AWS_SECRET_ACCESS_KEY: s3Options.secretAccessKey,
AWS_ENDPOINT: s3Options.endpoint,
AWS_BUCKET: S3Bucket,
},
stderr: "pipe",
stdout: "inherit",
stdin: "ignore",
},
);
expect(exitCode).toBe(0);
expect(stderr.toString()).toBe("");
},
30 * 1000,
);
it(
"fsFile.writer().write() should not leak",
async () => {
Expand Down

0 comments on commit e788166

Please sign in to comment.