-
Notifications
You must be signed in to change notification settings - Fork 118
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
loadtest: prepare for multiple consecutive runs #550
Conversation
@@ -20,7 +22,9 @@ import ( | |||
) | |||
|
|||
var ( | |||
zeroHash chainhash.Hash | |||
zeroHash chainhash.Hash | |||
regtestMiningAddr = "n1VgRjYDzJT2TV72PnungWgWu18SWorXZS" |
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.
Is seed generation by the nodes deterministic?
Do we need to also move to simnet, so bitcoind won't wipe the chain on start up?
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.
This is just to send to bitcoind
to specify where to mine the the coins to. We don't really ever use that address for anything else.
No, it's btcd
that drops the chain on startup, not bitcoind
. So we can switch batch to bitcoind
and regtest
.
t, alice, groupBalance, nil, collectGroupKey, | ||
) | ||
require.NoError(t, err) | ||
AssertUniverseRoot(t, alice, groupBalance, nil, collectGroupKey) |
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.
Wouldn't this just fail the test either way?
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.
Yeah, but before it was a mixture of require
and returning an error. And now we just do t.Fatalf()
directly instead of returning the error and then doing require.NoError()
outside.
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.
Thanks for helping me out here! Just had a similar question to Laolu re: the hardcoded mining address. I will give the changes a try in staging
itest/loadtest/mint_batch_test.go
Outdated
@@ -194,7 +196,18 @@ func mintBatchStressTest(t *testing.T, ctx context.Context, | |||
}, | |||
}, | |||
) | |||
require.NoError(t, err) | |||
if err != nil { | |||
require.ErrorContains(t, err, "universe server already added") |
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.
nit: not a big deal either way, but could make use of the defined error type here. Might be a bit more robust to changes in the error string.
if err != nil {
// Do not fail the test if we already have added the universe server!
require.ErrorIsf(t, err, universe.ErrDuplicateUniverse,
"unexpected error while adding remote universe server: %v", err)
}
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.
Good point! Though we cannot use ErrorIs
because the error is being sent over RPC and cannot directly be unwrapped/matched. But we can still use the error constant in ErrorContains
, which I'll fix.
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.
LGTM 🪁
4a10dd8
to
0afdb54
Compare
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.
Looks ok to me, just two nits.
To make sure a previous incomplete run doesn't trip up our test, we mine a block before we start and also one when we're done.
0afdb54
to
e5d4a15
Compare
Fixes #539.
This PR allows the load test to be run against both
btcd
andbitcoind
and also makes it ready for being run multiple times in a row against the same node.cc @calvinrzachman