Skip to content
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

BYRON_RESTORE_01 #2565

Closed
jonathanknowles opened this issue Mar 15, 2021 · 4 comments
Closed

BYRON_RESTORE_01 #2565

jonathanknowles opened this issue Mar 15, 2021 · 4 comments
Labels
Test failure A flaky test or nightly CI failure

Comments

@jonathanknowles
Copy link
Member

jonathanknowles commented Mar 15, 2021

Context

https://hydra.iohk.io/build/5803003/nixlog/1/tail

Test Case

BYRON_RESTORE_01

    describe "BYRON_RESTORE_01, GET_01, LIST_01 - Restore a wallet" $ do
        let scenarioSuccess style mnemonic ctx = runResourceT $ do
                let name = "Empty Byron Wallet"
                let payload = Json [json| {
                        "name": #{name},
                        "mnemonic_sentence": #{mnemonic},
                        "passphrase": #{fixturePassphrase},
                        "style": #{style}
                    }|]
                let discovery =
                        if style == "random"
                        then DiscoveryRandom
                        else DiscoverySequential
                let expectations =
                            [ expectField (#name . #getApiT . #getWalletName) (`shouldBe` name)
                            , expectField (#balance . #available) (`shouldBe` Quantity 0)
                            , expectField (#balance . #total) (`shouldBe` Quantity 0)
                            , expectField #passphrase (`shouldNotBe` Nothing)
                            , expectField #discovery (`shouldBe` discovery)
                            ]
                -- create
                r <- postByronWallet ctx payload
                liftIO $ verify r expectations
                let w = getFromResponse id r

                eventually "wallet is available and ready" $ do
                    -- get
                    rg <- request @ApiByronWallet ctx
                        (Link.getWallet @'Byron w) Default Empty
                    liftIO $ verify rg $
                        (expectField (#state . #getApiT) (`shouldBe` Ready)) : expectations
                    -- list
                    let wid = getFromResponse walletId rg
                    rl <- listFilteredByronWallets (Set.singleton wid) ctx
                    verify rl
                        [ expectResponseCode HTTP.status200
                        , expectListSize 1
                        , expectListField 0
                                (#name . #getApiT . #getWalletName) (`shouldBe` name)
                        , expectListField 0
                                (#balance . #available) (`shouldBe` Quantity 0)
                        , expectListField 0
                                (#state . #getApiT) (`shouldBe` Ready)
                        , expectListField 0
                                (#balance . #total) (`shouldBe` Quantity 0)
                        ]

Failure / Counter-example

Failures:

  src/Test/Integration/Scenario/API/Byron/Wallets.hs:187:59: 
  1) API Specifications, BYRON_WALLETS, BYRON_RESTORE_01, GET_01, LIST_01 - Restore a wallet, ledger 21 words
       While verifying (Status {statusCode = 200, statusMessage = "OK"},Right (ApiByronWallet {id = ApiT {getApiT = WalletId {getWalletId = 2a134a92288ed17a010d125d235737638a9cb7bd}}, balance = ApiByronWalletBalance {available = Quantity {getQuantity = 0}, total = Quantity {getQuantity = 0}}, assets = ApiWalletAssetsBalance {available = ApiT {getApiT = TokenMap (fromList [])}, total = ApiT {getApiT = TokenMap (fromList [])}}, discovery = DiscoverySequential, name = ApiT {getApiT = WalletName {getWalletName = "Empty Byron Wallet"}}, passphrase = Just (ApiWalletPassphraseInfo {lastUpdatedAt = 2021-03-15 10:09:52.583746751 UTC}), state = ApiT {getApiT = Syncing (Quantity {getQuantity = Percentage {getPercentage = 7447 % 10000}})}, tip = ApiBlockReference {absoluteSlotNumber = ApiT {getApiT = SlotNo 2105}, slotId = ApiSlotId {epochNumber = ApiT {getApiT = EpochNo {unEpochNo = 42}}, slotNumber = ApiT {getApiT = SlotInEpoch {unSlotInEpoch = 5}}}, time = 2021-03-15 10:07:29 UTC, block = ApiBlockInfo {height = Quantity {getQuantity = 1000}}}}))
       Waited longer than 90s to resolve action: "wallet is available and ready".
       expected: Ready
        but got: Syncing (Quantity {getQuantity = Percentage {getPercentage = 7447 % 10000}})

  To rerun use: --match "/API Specifications/BYRON_WALLETS/BYRON_RESTORE_01, GET_01, LIST_01 - Restore a wallet/ledger 21 words/"

Randomized with seed 1814347381

Resolution


QA

@Anviking
Copy link
Member

There can't really be any race-conditions here — I think the wallet simply is overloaded and can't keep up.

@Anviking
Copy link
Member

Anviking commented Jun 14, 2021

Logs of past failures:
2565.zip

Looking for db-busy warnings: didn't find that many.

Although before the logging rework, they wouldn't have been visible.

for f in *.log; echo $f (cat $f | grep "No more logs until it finishes" | wc -l); end;                                                                                                                                                                 13919.log        0
13941.log        0
14006.log       15
5803003.log        0
5831764.log        0
5873202.log        0
6163056.log       25
6235418.log        0
6298068.log       25

@Anviking
Copy link
Member

2565.zip

Using ./scripts/bors-stats.rb download-logs --tag "#2565" --after "25 Mar" to fetch logs from after the rework: I think it looks like there are "SQLITE_BUSY" errors right before each failure.

Skärmavbild 2021-06-15 kl  13 05 03

@Anviking
Copy link
Member

Not a prominent problem. Unclear whether a problem at all still. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test failure A flaky test or nightly CI failure
Projects
None yet
Development

No branches or pull requests

2 participants