From 8c83bcec854fb486551c762be6f0c41ba8694cd4 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 6 Sep 2019 22:24:55 +0200 Subject: [PATCH] fix(ci): avoid parallel ipfs.add* 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 --- src/files-regular/add-from-url.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/files-regular/add-from-url.js b/src/files-regular/add-from-url.js index 49bb5119..4a129939 100644 --- a/src/files-regular/add-from-url.js +++ b/src/files-regular/add-from-url.js @@ -2,7 +2,7 @@ 'use strict' const { getDescribe, getIt, expect } = require('../utils/mocha') -const parallel = require('async/parallel') +const series = require('async/series') const { echoUrl, redirectUrl } = require('../utils/echo-http-server') module.exports = (createCommon, options) => { @@ -34,7 +34,7 @@ module.exports = (createCommon, options) => { it('should add from a HTTP URL', (done) => { const text = `TEST${Date.now()}` const url = echoUrl(text) - parallel({ + series({ result: (cb) => ipfs.addFromURL(url, cb), expectedResult: (cb) => ipfs.add(Buffer.from(text), cb) }, (err, { result, expectedResult }) => { @@ -52,7 +52,7 @@ module.exports = (createCommon, options) => { const text = `TEST${Date.now()}` const url = echoUrl(text) + '?foo=bar#buzz' - parallel({ + series({ result: (cb) => ipfs.addFromURL(redirectUrl(url), cb), expectedResult: (cb) => ipfs.add(Buffer.from(text), cb) }, (err, { result, expectedResult }) => { @@ -91,7 +91,7 @@ module.exports = (createCommon, options) => { const filename = `TEST${Date.now()}.txt` // also acts as data const url = echoUrl(filename) + '?foo=bar#buzz' const addOpts = { wrapWithDirectory: true } - parallel({ + series({ result: (cb) => ipfs.addFromURL(url, addOpts, cb), expectedResult: (cb) => ipfs.add([{ path: filename, content: Buffer.from(filename) }], addOpts, cb) }, (err, { result, expectedResult }) => { @@ -107,7 +107,7 @@ module.exports = (createCommon, options) => { const filename = `320px-Domažlice,_Jiráskova_43_(${Date.now()}).jpg` // also acts as data const url = echoUrl(filename) + '?foo=bar#buzz' const addOpts = { wrapWithDirectory: true } - parallel({ + series({ result: (cb) => ipfs.addFromURL(url, addOpts, cb), expectedResult: (cb) => ipfs.add([{ path: filename, content: Buffer.from(filename) }], addOpts, cb) }, (err, { result, expectedResult }) => {