Wait until bitcoind is stopped in test.

This commit is contained in:
Braydon Fuller 2015-07-09 14:39:23 -04:00
parent db8cd7fa7e
commit 50c3bc43ab
3 changed files with 14 additions and 0 deletions

View File

@ -16,6 +16,10 @@ bitcoind.getBlock(blockHash, function(err, block) {
}
```
bitcoind.stop(function(err, result) {
// bitcoind is stopped
});
You can log output from the daemon using:
``` bash

View File

@ -38,6 +38,13 @@ describe('Basic Functionality', function() {
});
after(function(done) {
this.timeout(20000);
bitcoind.stop(function(err, result) {
done();
});
});
describe('will get correct block data', function() {
blockData.forEach(function(data) {

View File

@ -716,6 +716,9 @@ async_stop_node(uv_work_t *req) {
async_node_data *data = static_cast<async_node_data*>(req->data);
unhook_packets();
StartShutdown();
while(!shutdown_complete) {
usleep(1E6);
}
data->result = std::string("bitcoind shutdown.");
}