-
Notifications
You must be signed in to change notification settings - Fork 1.2k
race on jsipfs init
#796
race on jsipfs init
#796
Conversation
|
Node.js stable passes on circle, but fails on travis. Also passes on my machine. |
| err.code = 'ENOENT' | ||
| cb(err) | ||
| }) | ||
| this.node.once('start', cb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to wrap the cb into a once otherwise there could be a double calling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but there is a once listener, so it only does it once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but you register it twice, once for start and once for error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they are mutually exclusive, but I'll add it anyway just to be sure 👍
src/http-api/index.js
Outdated
| 'Access-Control-Expose-Headers', | ||
| 'X-Stream-Output, X-Chunked-Output, X-Content-Length') | ||
|
|
||
| this.server.start((err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be just this.server.start(cb) and then the rest below be in the next block
src/http-api/index.js
Outdated
|
|
||
| this.server.start((err) => { | ||
| if (err) { | ||
| return callback(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be cb
src/http-api/index.js
Outdated
| // for the CLI to know the where abouts of the API | ||
| fs.writeFileSync(apiFilePath, api.info.ma) | ||
|
|
||
| callback() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be cb
|
|
||
| beforeEach(() => { | ||
| repoPath = '/tmp/ipfs-test-' + Math.random().toString().substring(2, 8) | ||
| repoPath = '/tmp/ipfs-test-not-found-' + Math.random().toString().substring(2, 8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not-found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just making it obvious for my tests :)
…aemon start using the new init api \o/

sometimes, travis fails with a repo that wasn't fully initiated on
jsipfs init(just CLI)I'm being unable to replicate it locally, so this PR is just me throwing things to see if I can figure it out :)