Skip to content

Commit e38f53a

Browse files
author
Minggang Wang
authored
Merge pull request #162 from minggangw/run-client-sequentially
Run the cpp/py client sequentially
2 parents d4ca186 + c70b2df commit e38f53a

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

test/test-multi-nodes.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,23 +186,15 @@ describe('Multiple nodes interation testing', function() {
186186
'add_two_ints_client');
187187
var cppClient = childProcess.spawn(cppClientPath, ['-s', 'pycpp_js_add_two_ints']);
188188
var pyClientPath = path.join(__dirname, 'py', 'client.py');
189-
var pyClient = utils.launchPythonProcess([pyClientPath, 'pycpp_js_add_two_ints']);
190-
var cppClientExited = false, pyClientExited = false;
191189

192190
cppClient.stdout.on('data', (data) => {
193191
assert.deepStrictEqual(data.toString().trim(), 'Result of add_two_ints: 5');
194-
cppClientExited = true;
195-
if (pyClientExited) {
196-
done();
197-
}
198-
});
192+
var pyClient = utils.launchPythonProcess([pyClientPath, 'pycpp_js_add_two_ints']);
199193

200-
pyClient.stdout.on('data', (data) => {
201-
assert.deepStrictEqual(data.toString().trim(), '3');
202-
pyClientExited = true;
203-
if (cppClientExited) {
194+
pyClient.stdout.on('data', (data) => {
195+
assert.deepStrictEqual(data.toString().trim(), '3');
204196
done();
205-
}
197+
});
206198
});
207199
});
208200
});

0 commit comments

Comments
 (0)