-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: wait for multisig tx to arrive before continuing the test #308
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #308 +/- ##
=======================================
Coverage 86.98% 86.98%
=======================================
Files 35 35
Lines 1352 1352
Branches 269 269
=======================================
Hits 1176 1176
Misses 155 155
Partials 21 21 |
4dee570
to
f9be24a
Compare
}, timeout); | ||
} | ||
|
||
while ((await TestUtils.getTransaction(walletId, txId)).success === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a timeout
is passed as parameter, I believe this while
block will continue running even after a reject
is sent. ( similar case on a SO question )
Since this is an util used only on the integration tests, the effects of these "leaks" will probably not be very impactful, but I think it's important to at least document this behavior, so that future improvements can target this easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the SO answer I read this:
Unless an error is thrown, a function is executed until a return statement or its end is reached. Other code outside of the function can't interfere with that (unless, again, an error is thrown).
So if I just add the return reject
it should be enough, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this is not enough because the return
is ending the setTimeout
block, I've done some tests here and double-checked it.
I've done the timeout handling a bit differently, what do you think? 0978338
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a good solution 👍
0978338
to
affaff7
Compare
Issue: #292
Acceptance Criteria
Security Checklist