From 510cb6705668e6e4d8db70dcc0fdc5b93549dec7 Mon Sep 17 00:00:00 2001 From: Emil Sivervik Date: Mon, 25 Jan 2021 11:40:39 +0100 Subject: [PATCH] test: change function to write to file Co-authored-by: Darshan Sen --- test/parallel/test-fs-promises-file-handle-readFile.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/parallel/test-fs-promises-file-handle-readFile.js b/test/parallel/test-fs-promises-file-handle-readFile.js index 37adef17585d26..6ec3da33b7b2ca 100644 --- a/test/parallel/test-fs-promises-file-handle-readFile.js +++ b/test/parallel/test-fs-promises-file-handle-readFile.js @@ -97,8 +97,7 @@ async function doReadAndCancel() { const kIoMaxLength = 2 ** 31 - 1; const newFile = path.resolve(tmpDir, 'dogs-running3.txt'); - const buffer = Buffer.alloc(kIoMaxLength + 1); - await writeFile(newFile, buffer); + await truncate(newFile, kIoMaxLength + 1); const fileHandle = await open(newFile, 'r');