babylonchain / finality-provider

A peripheral program run by the finality providers
Other
16 stars 28 forks source link

need better error msg when e2e fails due to `babylond` process is not killed in previous runs #345

Open bap2pecs opened 5 months ago

bap2pecs commented 5 months ago

Problem

$ make test-e2e                                                                            [13:13:47]
cd tools; go install -trimpath github.com/babylonchain/babylon/cmd/babylond
go test -mod=readonly -timeout=25m -v github.com/babylonchain/finality-provider/itest -count=1 --tags=e2e
=== RUN   TestFinalityProviderLifeCycle
service injective.evm.v1beta1.Msg does not have cosmos.msg.v1.service proto annotation
service injective.evm.v1beta1.Msg does not have cosmos.msg.v1.service proto annotation
    test_manager.go:155: Babylon node is started
    test_manager.go:179: 
            Error Trace:    /Users/zidong/Documents/Projects/babylon-finality-provider/itest/test_manager.go:179
                                        /Users/zidong/Documents/Projects/babylon-finality-provider/itest/e2e_test.go:29
            Error:          Received unexpected error:
                            rpc error: code = NotFound desc = rpc error: code = NotFound desc = account bbn1g0th00wpag8c6j92uqe22frg5qk5pumhr7e4tg not found: key not found
            Test:           TestFinalityProviderLifeCycle

Root cause

babylond process is already running in the background

$ ps                                                                                        [13:14:35]
  PID TTY           TIME CMD
91437 ttys007    0:01.02 -zsh
90086 ttys011    0:00.40 /bin/zsh -il
93459 ttys011   21:01.34 babylond start --home=/var/folders/9_/q4wsdnh14_s60_74cd2rbztm0000gp/T/zBabylonTest529388438/node0
14010 ttys012    0:00.41 -zsh

Suggestions

  1. better error msg
  2. figure out a way to graceful exit the process even when e2e test fails
bap2pecs commented 4 months ago

related to #397 but there is a subtle diff

this one focus more on informing the reader about there is a background process running that caused the issue