test(systemtest): fix cometbft client (#22835)

This commit is contained in:
Julien Robert 2024-12-11 21:36:48 +01:00 committed by GitHub
parent a38a6a2c8b
commit f2663280c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 20 deletions

View File

@ -8,8 +8,6 @@ import (
"sync"
"time"
"golang.org/x/sync/errgroup"
corelog "cosmossdk.io/core/log"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/store/v2"
@ -305,24 +303,14 @@ func (s *Store) Commit(cs *corestore.Changeset) ([]byte, error) {
// background pruning process (iavl v1 for example) which must be paused during the commit
s.pruningManager.PausePruning()
eg := new(errgroup.Group)
// commit SC async
var cInfo *proof.CommitInfo
eg.Go(func() error {
if err := s.stateCommitment.WriteChangeset(cs); err != nil {
return fmt.Errorf("failed to write batch to SC store: %w", err)
}
var scErr error
cInfo, scErr = s.stateCommitment.Commit(cs.Version)
if scErr != nil {
return fmt.Errorf("failed to commit SC store: %w", scErr)
}
return nil
})
if err := s.stateCommitment.WriteChangeset(cs); err != nil {
return nil, fmt.Errorf("failed to write batch to SC store: %w", err)
}
if err := eg.Wait(); err != nil {
return nil, err
cInfo, err := s.stateCommitment.Commit(cs.Version)
if err != nil {
return nil, fmt.Errorf("failed to commit SC store: %w", err)
}
if cInfo.Version != cs.Version {

View File

@ -27,7 +27,12 @@ func TestQueryStatus(t *testing.T) {
cli := systest.NewCLIWrapper(t, systest.Sut, systest.Verbose)
systest.Sut.StartChain(t)
resp := cli.CustomQuery("status")
var resp string
if systest.IsV2() {
resp = cli.CustomQuery("comet", "status")
} else {
resp = cli.CustomQuery("status")
}
// make sure the output has the validator moniker.
assert.Contains(t, resp, "\"moniker\":\"node0\"")
@ -223,7 +228,7 @@ func TestValidatorSetByHeight(t *testing.T) {
}
}
func TestValidatorSetByHeight_GRPCRestGateway(t *testing.T) {
func TestValidatorSetByHeight_GRPCGateway(t *testing.T) {
systest.Sut.ResetChain(t)
systest.Sut.StartChain(t)
@ -257,7 +262,9 @@ func TestValidatorSetByHeight_GRPCRestGateway(t *testing.T) {
}
func TestABCIQuery(t *testing.T) {
systest.Sut.ResetChain(t)
systest.Sut.StartChain(t)
_ = systest.Sut.AwaitNextBlock(t, time.Second*3)
qc := cmtservice.NewServiceClient(systest.Sut.RPCClient(t))
cdc := codec.NewProtoCodec(codectypes.NewInterfaceRegistry())