mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 19:51:20 +00:00
More Precise Metrics E2E (#9331)
* metrics test copute slots since genesis * gazelle Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
parent
57fac9b74f
commit
4f0b00894b
@ -27,6 +27,7 @@ go_library(
|
||||
"//shared/p2putils:go_default_library",
|
||||
"//shared/params:go_default_library",
|
||||
"//shared/sliceutil:go_default_library",
|
||||
"//shared/slotutil:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"@com_github_pkg_errors//:go_default_library",
|
||||
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
|
||||
|
@ -17,6 +17,7 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/endtoend/types"
|
||||
eth "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
||||
"github.com/prysmaticlabs/prysm/shared/p2putils"
|
||||
"github.com/prysmaticlabs/prysm/shared/slotutil"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
@ -109,14 +110,17 @@ func metricsTest(conns ...*grpc.ClientConn) error {
|
||||
}
|
||||
time.Sleep(connTimeDelay)
|
||||
|
||||
chainHead, err := eth.NewBeaconChainClient(conns[i]).GetChainHead(context.Background(), &emptypb.Empty{})
|
||||
beaconClient := eth.NewBeaconChainClient(conns[i])
|
||||
nodeClient := eth.NewNodeClient(conns[i])
|
||||
chainHead, err := beaconClient.GetChainHead(context.Background(), &emptypb.Empty{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
timeSlot, err := valueOfTopic(pageContent, "beacon_clock_time_slot")
|
||||
genesisResp, err := nodeClient.GetGenesis(context.Background(), &emptypb.Empty{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
timeSlot := slotutil.SlotsSinceGenesis(genesisResp.GenesisTime.AsTime())
|
||||
if uint64(chainHead.HeadSlot) != uint64(timeSlot) {
|
||||
return fmt.Errorf("expected metrics slot to equal chain head slot, expected %d, received %d", chainHead.HeadSlot, timeSlot)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user