-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add more waitForTxImmutability #2708
Conversation
Looking at recent HWWallet failures, they seem to come from just a few locations. So we can easily switch them out to use the more rollback-resistent waitForTxImmutability. ``` $ ./scripts/bors-stats.rb list 2428 --search "Wallets" --count 300 --details true | grep "Wallets.hs:" Ê | src/Test/Integration/Scenario/CLI/Shelley/HWWallets.hs:153:26: Ê | cardano-wallet > src/Test/Integration/Scenario/CLI/Shelley/HWWallets.hs:152:26: src/Test/Integration/Scenario/API/Byron/Wallets.hs:187:59: Ê | cardano-wallet > src/Test/Integration/Scenario/CLI/Shelley/HWWallets.hs:152:26: Ê | cardano-wallet > src/Test/Integration/Scenario/CLI/Shelley/HWWallets.hs:152:26: cardano-wallet > src/Test/Integration/Scenario/CLI/Shelley/HWWallets.hs:152:26: cardano-wallet > src/Test/Integration/Scenario/CLI/Shelley/HWWallets.hs:152:26: cardano-wallet > src/Test/Integration/Scenario/CLI/Shelley/HWWallets.hs:152:26: src/Test/Integration/Scenario/CLI/Shelley/HWWallets.hs:129:18: cardano-wallet > src/Test/Integration/Scenario/CLI/Shelley/HWWallets.hs:152:26: ```
bors try |
tryBuild failed:
|
The test that failed above is one of the tests which got the It raises the question of whether this fix is an effective way of fixing the flaky integration tests. I believe that The pause/resume solution should be more robust, but these changes are probably still helpful in the meantime. |
531586d
to
88125a5
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.
Thanks - this should help, even if we still get failures for different reasons.
I modified the DSL verify
function to include a descriptive message, and also to pretty-show the value being checked.
@@ -122,13 +124,16 @@ spec = describe "SHELLEY_CLI_HW_WALLETS" $ do | |||
_ <- expectValidJSON (Proxy @(ApiTransaction n)) op | |||
cp `shouldBe` ExitSuccess | |||
|
|||
eventually "Wallet balance is as expected" $ do |
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 was thinking that it would be a shame to lose these high-level functional descriptions of that conditions are being tested.
So I have added a verifyMsg
function which includes such a description.
a482971
to
8f8dbc8
Compare
-- | A convenience wrapper type for pretty-showing test values. | ||
|
||
module Test.Utils.Pretty | ||
( Pretty (..) |
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 idea 👍 I didn't see that it existed before in SelectionSpec
@@ -80,6 +83,9 @@ class ToText a where | |||
-- | Encode the specified value as text. | |||
toText :: a -> Text | |||
|
|||
default toText :: Buildable a => a -> Text |
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.
✔️
Awesome, thanks @rvl! bors r+ |
2708: Add more waitForTxImmutability r=Anviking a=Anviking # Issue Number ADP-970 / #2428 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] Replace `eventually` with `waitForTxImmutability` in exactly the locations where we've seen failures (#2428 ) # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket ✓ Acknowledge any changes required to the Wiki ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages. --> Co-authored-by: Johannes Lund <[email protected]> Co-authored-by: Rodney Lorrimar <[email protected]>
Build failed:
|
I thought so too, and was pretty confident, but with this immediate second failure I'm starting to wonder 🤔 |
I do recall a case where it was successful in some TX_EXTERNAL tests, but don't recall the details / care to find link now But this might be something new... |
bors try |
tryBuild failed: |
bors try |
tryBuild failed: |
The fact that it is failing seemingly consistently is interesting... |
2724: Add Test.Utils.Pretty and verifyMsg r=Anviking a=rvl ### Issue Number ADP-970 ### Overview - Add a more descriptive `verifyMsg` function to the integration tests. - Move the `Pretty` helper newtype into `Test.Utils.Pretty`. ### Comments This code was rescued from #2708. Co-authored-by: Rodney Lorrimar <[email protected]>
2724: Add Test.Utils.Pretty and verifyMsg r=Anviking a=rvl ### Issue Number ADP-970 ### Overview - Add a more descriptive `verifyMsg` function to the integration tests. - Move the `Pretty` helper newtype into `Test.Utils.Pretty`. ### Comments This code was rescued from #2708. Co-authored-by: Rodney Lorrimar <[email protected]>
2724: Add Test.Utils.Pretty and verifyMsg r=Anviking a=rvl ### Issue Number ADP-970 ### Overview - Add a more descriptive `verifyMsg` function to the integration tests. - Move the `Pretty` helper newtype into `Test.Utils.Pretty`. ### Comments This code was rescued from #2708. Co-authored-by: Rodney Lorrimar <[email protected]>
Issue Number
ADP-970 / #2428
Overview
eventually
withwaitForTxImmutability
in exactly the locations where we've seen failures ((Instance of #2855) Flaky: HW_WALLETS_01x - Restoration from account public key preserves funds #2428 )Comments