-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
multi: fix unit test flakes #7954
multi: fix unit test flakes #7954
Conversation
9fb5b68
to
5d21d06
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.
Great fixes!
It looks like CI also ran into another one-in-however-million chances.
Here's the fix for the aezeed
flake:
diff --git a/aezeed/cipherseed_test.go b/aezeed/cipherseed_test.go
index 7547f25e9..12c491966 100644
--- a/aezeed/cipherseed_test.go
+++ b/aezeed/cipherseed_test.go
@@ -533,7 +533,16 @@ func TestDecipherIncorrectMnemonic(t *testing.T) {
// a checksum failure.
swapIndex1 := 9
swapIndex2 := 13
- mnemonic[swapIndex1], mnemonic[swapIndex2] = mnemonic[swapIndex2], mnemonic[swapIndex1]
+ mnemonic[swapIndex1], mnemonic[swapIndex2] =
+ mnemonic[swapIndex2], mnemonic[swapIndex1]
+
+ // If the words happen to be the same by pure chance, we'll try again
+ // with different indexes.
+ if mnemonic[swapIndex1] == mnemonic[swapIndex2] {
+ swapIndex1 = 3
+ mnemonic[swapIndex1], mnemonic[swapIndex2] =
+ mnemonic[swapIndex2], mnemonic[swapIndex1]
+ }
// If we attempt to decrypt now, we should get a checksum failure.
// If we attempt to map back to the original cipher seed now, then we
lnwallet/chainfee/estimator_test.go
Outdated
err string | ||
name string | ||
target uint32 | ||
apiEst uint32 |
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: apiEst
is no longer used.
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.
removed!
Fix the following uint test flake, ``` --- FAIL: TestHistoricalConfDetailsTxIndex (0.00s) --- FAIL: TestHistoricalConfDetailsTxIndex/rpc_polling_enabled (1.16s) bitcoind_test.go:174: should have found the transaction within the mempool, but did not: TxNotFoundIndex FAIL ```
When the numTweaks is zero, we should return a nil instead of initializing an empty map as we'd get the following error, ``` Diff: --- Expected +++ Actual @@ -11007,4 +11007,3 @@ }, - BreachedHtlcTweaks: (contractcourt.htlcTapTweaks) { - }, + BreachedHtlcTweaks: (contractcourt.htlcTapTweaks) <nil>, ```
5d21d06
to
50f2c27
Compare
@guggero thanks for the diff! Also interesting to see we hit the lottery here. Now let's see when we hit |
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.
Very nice, LGTM 🎉
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 🕷️
|
||
// If the numTweaks happens to be zero, we return a nil to avoid | ||
// initializing the map. | ||
if numTweaks == 0 { |
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.
👍
Noticed a flake in
|
Fix three uint test flakes,