Skip to content
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

Merged
merged 8 commits into from
Sep 6, 2017
Merged

Slay the Dragon! #165

merged 8 commits into from
Sep 6, 2017

Conversation

daviddias
Copy link
Member

@daviddias daviddias commented Sep 6, 2017

It seems that running our tests in Node.js 8 always fail in AppVeyor and locally (not in Travis or Circle CI interestingly enough)

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))
Copy link
Member Author

@daviddias daviddias Sep 6, 2017

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?

Copy link
Member

@dignifiedquire dignifiedquire Sep 6, 2017

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

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

@daviddias
Copy link
Member Author

This PR solves the issues that #150 was trying to solve.

@daviddias daviddias changed the title Something is weird (possible race condition) with Node.js 8 Slay the Dragon! Sep 6, 2017
@daviddias
Copy link
Member Author

@daviddias
Copy link
Member Author

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.

@daviddias
Copy link
Member Author

image

wubbalubbadubdub 🎉

expect(api).to.have.property('apiHost')
expect(api).to.have.property('apiPort')
expect(api).to.have.property('gatewayHost')
expect(api).to.have.property('gatewayPort')
Copy link
Member

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.
Copy link
Member

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

@daviddias
Copy link
Member Author

Thanks @victorbjelkholm :)

@daviddias daviddias merged commit 80377cd into master Sep 6, 2017
@daviddias daviddias deleted the check-node-8 branch September 6, 2017 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants