Skip to content

Conversation

@CaleCrawford
Copy link

  • Looks for presence of forked boolean in mongod.conf.
  • If forked: true the process is started in forked mode and the output is used to return success.
  • When the close method is run, ps-node is used to look for the forked process and then kill it.

To the best of my knowledge none of this interferes with the currently implemented functionality. I would be happy to comment/document anything further that you think needs it. I also have a similar fix for the redis version.

Closes #1

@CaleCrawford
Copy link
Author

I will fix the linting errors.

@CaleCrawford
Copy link
Author

CaleCrawford commented Aug 1, 2017

For running the tests locally I am getting:
Error: 2017-07-31T17:22:51.496-0700 I STORAGE [initandlisten] exception in initAndListen: 98 Unable to lock file: data/db/3725adce-8b8f-437f-8577-15dec73cc9cd/mongod.lock Resource temporarily unavailable. Is a mongod instance already running?, terminating
any idea what I'm doing wrong?

(edit) - Locally that file is being created

@BrandonZacharie
Copy link
Owner

BrandonZacharie commented Aug 1, 2017

It likely means an instance of MongoDB is already running. Test failures may leave orphaned MongoDB processes running in the background. grep processes for mongod to see if that's the case. If not, the problem is likely with the test itself.

Edit:
Alternatively, it could be the changes you've made; provide tests for killForkedProcess() to verify it works as desired first.

@coveralls
Copy link

coveralls commented Aug 3, 2017

Coverage Status

Coverage decreased (-1.3%) to 98.667% when pulling 54d1c20 on CaleCrawford:develop into 83dc9a1 on BrandonZacharie:develop.

@CaleCrawford
Copy link
Author

Thank you for the input, sorry it has been a bit of time in between my responses. Okay I wrote a few tests to test various aspects of the method. I am having trouble testing the reject() statements that run if ps-node throws an error. From my latest commit those are Mongod.js lines :228 and :235. Do you have any suggestions about how to get at those lines with a test? Im hesitant to just pull those lines but I will if thats better.

The travis-ci build had a timeout error for: node 4.8.4, node ~5, and node 6.0. The others passed. I tried running the tests locally using v4.8.4 and it passed. Any ideas why that would be working locally but failing on the ci build?

Thank you again for taking the time to work through this with me. Im pretty new to open source so I appreciate your input.

@BrandonZacharie
Copy link
Owner

Good work getting this far. I suspect that the first timeout causes cascading test failures. I'll look at what you've got and revisit the Travis configuration this weekend.

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.

Trouble Forking Process

3 participants