-
Notifications
You must be signed in to change notification settings - Fork 115
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: Multiple txsource fixes #5192
Conversation
a5ea3e5
to
cb9ded1
Compare
Codecov Report
@@ Coverage Diff @@
## master #5192 +/- ##
==========================================
- Coverage 61.58% 61.51% -0.08%
==========================================
Files 512 512
Lines 53980 53980
==========================================
- Hits 33244 33205 -39
- Misses 16509 16565 +56
+ Partials 4227 4210 -17
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -302,6 +303,8 @@ func (r *registration) Run( // nolint: gocyclo | |||
} | |||
} | |||
} | |||
// Cleanup temporary identities directory after generation. | |||
_ = os.RemoveAll(nodeIdentitiesDir) |
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.
Any special reason why removing twice?
@@ -256,6 +254,9 @@ func (r *registration) Run( // nolint: gocyclo | |||
|
|||
entityAccs[i].nodeIdentities = append(entityAccs[i].nodeIdentities, &nodeAcc{ident, nodeDesc, nodeAccNonce}) | |||
ent.Nodes = append(ent.Nodes, ident.NodeSigner.Public()) | |||
|
|||
// Cleanup temporary node identity directory after generation. | |||
_ = os.RemoveAll(dataDir) |
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.
Move higher and use defer
inside func
to remove also on error.
if isSynced, _ := q.control.IsSynced(loopCtx); !isSynced { | ||
_ = q.control.WaitSync(loopCtx) | ||
time.Sleep(1 * time.Second) | ||
continue |
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.
It's a good practice to always cancel context.
We are stealing time from query timeout when syncing, not sure if a problem.
If the node never syncs, we never gracefully exit the loop.
I think one line could be removed.
if err = q.control.WaitSync(loopCtx); err != nil {
time.Sleep(time.Second)
continue
}
``
No description provided.