making flaky test more stable
diff --git a/test/nodejs.test.js b/test/nodejs.test.js
index 7369529..4608187 100644
--- a/test/nodejs.test.js
+++ b/test/nodejs.test.js
@@ -490,7 +490,7 @@
{ msg: "CORRECT/RESULT" },
async () => {
// change action.js to test reloading
- console.log("simulating modifiying action.js...");
+ console.log("[test] simulating modifiying action.js...");
fs.writeFileSync(`action.js`,
`
@@ -501,7 +501,7 @@
}
`);
- await sleep(1);
+ await sleep(100);
},
{ msg: "SECOND" },
true // binary
diff --git a/test/test.js b/test/test.js
index ce8904d..74ac79d 100644
--- a/test/test.js
+++ b/test/test.js
@@ -282,6 +282,7 @@
nockActivation(
action,
body => {
+ console.log("[test] mockActionDoubleInvocation: asserting result1")
assert.deepStrictEqual(body, result1);
return true;
}
@@ -298,8 +299,8 @@
result2.$activationId = activationId2;
nockActivation(action, body => body.$waitForActivation === true)
- .reply(200, () => {
- runBetween();
+ .reply(200, async () => {
+ await runBetween();
return {
response: {
result: Object.assign(params, { $activationId: activationId2 })
@@ -311,6 +312,7 @@
nockActivation(
action,
body => {
+ console.log("[test] mockActionDoubleInvocation: asserting result2")
assert.deepStrictEqual(body, result2);
return true;
}