Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: flakey windows test (#1987)
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
  • Loading branch information
Alan Shaw authored Apr 11, 2019
1 parent c86e8a1 commit 9708c0a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/cli/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,17 @@ describe('daemon', () => {
await ipfs('config', 'Addresses.API', JSON.stringify(apiAddrs), '--json')
await ipfs('config', 'Addresses.Gateway', JSON.stringify(gatewayAddrs), '--json')

const out = await new Promise(resolve => {
const out = await new Promise((resolve, reject) => {
const res = ipfs('daemon')
let out = ''

res.stdout.on('data', function onData (data) {
out += data
if (out.includes('Daemon is ready')) {
res.stdout.removeListener('data', onData)
const onKilled = () => resolve(out)
res.then(onKilled).catch(onKilled)
res.kill()
resolve(out)
}
})
})
Expand All @@ -134,16 +135,17 @@ describe('daemon', () => {
await ipfs('config', 'Addresses.API', '[]', '--json')
await ipfs('config', 'Addresses.Gateway', '[]', '--json')

const out = await new Promise(resolve => {
const out = await new Promise((resolve, reject) => {
const res = ipfs('daemon')
let out = ''

res.stdout.on('data', function onData (data) {
out += data
if (out.includes('Daemon is ready')) {
res.stdout.removeListener('data', onData)
const onKilled = () => resolve(out)
res.then(onKilled).catch(onKilled)
res.kill()
resolve(out)
}
})
})
Expand Down

0 comments on commit 9708c0a

Please sign in to comment.