Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

fix(ci): avoid fs clash during ipfs.add* on Windows #523

Closed
wants to merge 1 commit into from

Conversation

lidel
Copy link
Contributor

@lidel lidel commented Sep 6, 2019

This PR fixes random TravisCI failures on Windows and unblocks ipfs/js-ipfs#2304

Root cause

Windows issue was triggered by parallel ipfs.add* of the same data:

      parallel({
        result: (cb) => ipfs.addFromURL(url, cb),
        expectedResult: (cb) => ipfs.add(Buffer.from(text), cb)
      }, (err, { result, expectedResult }) => {
        expect(err).to.not.exist()

Both addFromURL and add added the same data, touched same files on filesystem, triggering a known problem with Node on Windows and Travis:

Fix

One way to fix this type of error is to run as Windows Administrator. It does not seem to be feasible for TravisCI.

Instead, switching to sequential mode of operation removes addFromURL tests as a surface for file system race conditions on Windows.

TravisCI often fails on Windows due to parallel add* clashing with the
way Node manages fs access on Windows. Switching to one after should
stabilize test suite on Windows by removing surface for those race
conditions.

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
@alanshaw
Copy link
Contributor

alanshaw commented Sep 9, 2019

The fix for this is ipfs/js-datastore-fs#27

@hugomrdias
Copy link
Contributor

The fix for this is ipfs/js-datastore-fs#27

That was merged into 0.8.x branch and ipfs-repo is on 0.9.x
@achingbrain do we need to port it to master ?

@achingbrain
Copy link
Collaborator

The PR for the 0.9.x branch is ipfs/js-datastore-fs#28

@lidel
Copy link
Contributor Author

lidel commented Sep 9, 2019

Should we close this, and bubble up the datastore fix instead?

@lidel
Copy link
Contributor Author

lidel commented Sep 9, 2019

Closing, as ipfs/js-ipfs#2304 confirmed this is fixed in js-datastore-fs

@lidel lidel closed this Sep 9, 2019
@lidel lidel deleted the fix/eperm-error-on-windows branch September 9, 2019 11:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants