Skip to content

Travis CI - creation time based test fails 100% of the time on Node V8 #1

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
joshuatz opened this issue Sep 19, 2019 · 1 comment
Closed

Comments

@joshuatz
Copy link
Owner

Strange issue. There is one test that is meant to cover the fallback feature of the scraper; if there is no git history, it will try to retrieve the timestamps based on standard node stat or lstat. To test this, I create some files, and "touch" one of them by both appending actual text to it, as well as forcibly changing the attributes.

On Windows, on Node V8 included, this test passes. However, on Travis CI, which is running Ubuntu, on Node v8 only, after file modification the "timeDelay" comes back as zero seconds, which would seem to indicate that the birthtimeMs is identical to mtimeMs, even after touching the file.

This really doesn't make much sense, given how many ways I am trying to force it to recognize a file modification has occurred.

I'm going to do some more digging, but this is really hard to troubleshoot, since I can't replicate at all locally.

@joshuatz
Copy link
Owner Author

Finally found the issue. The short summary is that birthtime is unavailable on Linux, without using the newer statx(), which is available as a syscall / exposed via glibc, in kernel 4.11+. Node integrated this ability in v10.16.0+, so long as the kernel supports it.

Although the root cause can't really be fixed for Node V8 (at least without implementing glibc syscalls myself), test was patched by c7a6786 and then tweaked in 6bfc0c8. Essentially I skip the test that relies on a valid creation stamp if (node v < 10.16.0 && linux) OR (node v >= 10.16.0 && linux && kernel < 4.11).

Travis-CI is now passing on Node v8.

@joshuatz joshuatz changed the title Travis CI - mtime based test fails 100% of the time on Node V8 Travis CI - creation time based test fails 100% of the time on Node V8 Sep 21, 2019
joshuatz added a commit that referenced this issue Nov 2, 2019
 - Multiple methods, including main, were refactored to be async based
 - Found that console.log was adding some overhead, so reduced use except behind --debug flag
 - Updated tests
 - Updated documentation
 - Also fixed some TS stuff
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant