Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Conversation

@valentinewallace
Copy link
Contributor

@valentinewallace valentinewallace commented Nov 3, 2018

Closes #761.

There is one odd flake that has a slightly different failure, but the other 17 or so had the same failure.

I've been experiencing this flake locally for a while now, and I'm not sure what about reset-password caused it to suddenly surface in production. Regardless, this change fixed it for me locally so I think it should fix it on travis as well.

@valentinewallace valentinewallace requested a review from tanx November 3, 2018 00:43
This function is useful when a process is being killed and then restarted, because if a process has not been fully killed when its restart is attempted it will silently fail to restart. This function ensures a process has been terminated before returning because  will error if given a pid for a process that doesn't exist.
Previously, we were attempting to restart btcd before the original process was fully terminated, causing the restart to silently fail.
Copy link
Contributor

@tanx tanx left a comment

Choose a reason for hiding this comment

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

Just one question...

await nap(500);
} catch (e) {
terminated = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What if process.kill() is successful? Will it still throw an exception?

Copy link
Contributor Author

@valentinewallace valentinewallace Nov 5, 2018

Choose a reason for hiding this comment

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

If process.kill() is successful, then it will error on the next attempt to kill it because the process doesn't exist anymore. I couldn't find any other way to determine whether the process was actually dead.

Tried process.terminated, tried process.on(SIGINT)/other event handlers. Those could probably work if I put in a sleep after they occur and then restarted btcd, but I wanted to avoid sleeps.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok. Let's see if this helps.

@tanx tanx merged commit bb7b66a into master Nov 5, 2018
@tanx tanx deleted the fix-integ-test-flakes branch November 5, 2018 21:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate why integration tests are flakey and make them more robust

3 participants