Node: test: two unexpected failures when disk is nearly full

Created on 8 Jul 2016  路  17Comments  路  Source: nodejs/node

$ python tools/test.py parallel/test-fs-read-buffer-tostring-fail parallel/test-fs-readfile-tostring-fail
=== release test-fs-read-buffer-tostring-fail ===
Path: parallel/test-fs-read-buffer-tostring-fail
(node:23280) DeprecationWarning: fs.read's legacy String interface is deprecated. Use the Buffer API as mentioned in the documentation instead.

/home/bnoordhuis/src/v1.x/test/parallel/test-fs-read-buffer-tostring-fail.js:56
  throw err;
  ^
AssertionError: false == true
    at /home/bnoordhuis/src/v1.x/test/parallel/test-fs-read-buffer-tostring-fail.js:30:12
    at /home/bnoordhuis/src/v1.x/test/common.js:407:15
    at tryToStringWithEnd (fs.js:697:3)
    at callback (fs.js:666:9)
    at FSReqWrap.wrapper [as oncomplete] (fs.js:681:17)
Command: out/Release/node /home/bnoordhuis/src/v1.x/test/parallel/test-fs-read-buffer-tostring-fail.js
=== release test-fs-readfile-tostring-fail ===
Path: parallel/test-fs-readfile-tostring-fail
/home/bnoordhuis/src/v1.x/test/parallel/test-fs-readfile-tostring-fail.js:51
  throw err;
  ^
AssertionError: false == true
    at /home/bnoordhuis/src/v1.x/test/parallel/test-fs-readfile-tostring-fail.js:27:12
    at /home/bnoordhuis/src/v1.x/test/common.js:407:15
    at tryToString (fs.js:455:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:442:12)

Both tests try to create a largish file (~250 MB) but instead of failing with an ENOSPC error, they appear to be truncating the file.

They then fail when trying to read back the file. The toString() operation doesn't raise the expected error because the input is too small to trigger it.

CI / flaky test fs help wanted test

All 17 comments

By any chance are you running an older version of Node? I saw this behavior with an old version that didn't have kStringMaxLength defined. Once I defined kStringMaxLength, I got ENOSPC.

Depends on your definition of 'older'. It was yesterday's master.

Sorry, I meant a much, much older version.

@nodejs/testing @nodejs/fs

@bnoordhuis are these still up to date?

I think so. I don't have a problem with closing it out; the errors are confusing / misleading but it's something of an edge case.

Is it possible that this is a duplicate of https://github.com/nodejs/node/issues/16601 ?

I don't think so. The latest failure in #16601 is a timeout, not a failed assert. The one before that is a missing expected error, which probably also isn't this issue.

I can poke at this issue and try to fix the flakiness.

FWIW one of these tests is now here in master.

test/sequential/test-fs-readfile-tostring-fail.js

  1. I'm not sure where the assert @bnoordhuis indicated is failing though.

  2. I am not sure what has become of

test/parallel/test-fs-read-buffer-tostring-fail.js

Is it still in master?

Should I be looking on another branch?

@Trott Should I just look at #16601 instead?

test/parallel/test-fs-read-buffer-tostring-fail.js was removed in 3c2a9361ffd797acd6c9f5a09ae01648aa0e9792.

So this is now only about test/sequential/test-fs-readfile-tostring-fail.js.

I'm not sure where the assert @bnoordhuis indicated is failing though.

State of the file on master when @bnoordhuis opened this PR:

https://github.com/nodejs/node/blob/85ab4a5f1281c4e1dd06450ac7bd3250326267fa/test/parallel/test-fs-readfile-tostring-fail.js

Stack trace provided by @bnoordhuis above says that the assertion is firing on line 27, which is:

    assert.ok(err instanceof Error);

ping @davisjam - were you able to make any progress on this?

Afraid I haven't looked at it yet.

do you mind if I tag good first issue on this to help move this forward, if you are low on bandwidth?

@gireeshpunathil By all means.

(Just a suggestion: Might want to consider tagging it help wanted rather than good first issue.)

I'm going to close this out, no one has really volunteered to fix these in the two years and it's a fairly edge case issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vsemozhetbyt picture vsemozhetbyt  路  3Comments

akdor1154 picture akdor1154  路  3Comments

dfahlander picture dfahlander  路  3Comments

seishun picture seishun  路  3Comments

danielstaleiny picture danielstaleiny  路  3Comments