-
Notifications
You must be signed in to change notification settings - Fork 20.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
accounts/keystore: fix flaky test TestWalletNotifications
#30053
base: master
Are you sure you want to change the base?
Conversation
Could you dump out the difference between |
@MariusVanDerWijden I have Dumped out the difference between It's more difficult to fix |
@MariusVanDerWijden I have found the reason for
If we only fix the flaky test issue, to avoid executing 4m15s: 22560 runs so far, 0 failures
4m20s: 22988 runs so far, 0 failures
4m25s: 23383 runs so far, 0 failures
4m30s: 23813 runs so far, 0 failures
4m35s: 24238 runs so far, 0 failures
4m40s: 24664 runs so far, 0 failures
4m45s: 25082 runs so far, 0 failures
4m50s: 25537 runs so far, 0 failures
4m55s: 25990 runs so far, 0 failures
5m0s: 26422 runs so far, 0 failures
5m5s: 26863 runs so far, 0 failures
5m10s: 27315 runs so far, 0 failures
5m15s: 27758 runs so far, 0 failures
5m20s: 28207 runs so far, 0 failures
5m25s: 28631 runs so far, 0 failures |
@MariusVanDerWijden Upgraded to use |
TestWalletNotifications
Cool nice find, reaching into the cache to acquire the lock kinda feels a bit weird to me. Feels like we are crossing the boundaries of our abstraction. I will think a bit about it |
I'm not sure about the changes in |
Then there must be something wrong with the order of events sent by wallet addition and removal. All events were handled correctly indeed, no events were missing actually, but they were not in the expected order. |
edit: nm, it looks like these changes now fix the |
There is no event missing. All events were handled correctly indeed, no events were missing actually, but they were not in the expected order. We need to find out why they are out of order. |
This PR fixes the
checkEvents
part of the flaky testTestWalletNotifications
. There is another flaky failure forcheckAccounts
.The original logic of
checkEvents
seems to ask for bothwantEvents
andhaveEvents
to keep a consistent order so that this function could work correctly.But actually, the order of both is not consistent. See the failed log comment on #29830
keystore_test.go:455: can't find event with Kind=2 for 56fe5c503fb7f1850298b7d6896cfd8019b525e1
Before this patch, the stress test of
TestWalletNotifications
failed bycheckAccounts
andcheckEvents
After this patch, the stress test of
TestWalletNotifications
only failed bycheckAccounts
.