-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slay the Dragon! #165
Slay the Dragon! #165
Conversation
const dir = `${os.tmpdir()}/tmp-${Date.now() + '-' + Math.random().toString(36)}` | ||
|
||
async.waterfall([ | ||
(cb) => ipfsd.local(dir, cb), | ||
(node, cb) => { | ||
daemon = node | ||
node.init((err) => cb(err, node)) |
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.
Seems like in Node.js 8 a copy was being made instead of a reference.. WAT?
@dignifiedquire @victorbjelkholm any clue?
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.
Hmm that sounds dubious, we should not change the test, if this is making copies there is likely a larger issue at play which will be a problem for users of ipfsd-ctl
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.
It seems that this didn't fixed it after all, I just got lucky
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.
got it
This PR solves the issues that #150 was trying to solve. |
Given the sensitivity of this module, I appreciate all the CR I can get :) tl;dr; There were some big issues on how daemons were being spawned and it mostly worked because the race condition was in our favor. Node.js 8 changed that. |
expect(api).to.have.property('apiHost') | ||
expect(api).to.have.property('apiPort') | ||
expect(api).to.have.property('gatewayHost') | ||
expect(api).to.have.property('gatewayPort') |
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.
These checks are unnecessary as the ones below will check if the property exists and is equal to the value.
src/index.js
Outdated
}, | ||
|
||
/** | ||
* Create a new disposable node and already start the daemon. |
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.
Minor typo
already started daemon
Thanks @victorbjelkholm :) |
It seems that running our tests in Node.js 8 always fail in AppVeyor and locally (not in Travis or Circle CI interestingly enough)