From 940a906e191b3bf6831957051ac419005ea0e551 Mon Sep 17 00:00:00 2001 From: tbjump Date: Thu, 13 Jul 2023 17:05:07 +0000 Subject: [PATCH] node/node_test: Test automatic re-observation requests --- node/pkg/node/node_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/node/pkg/node/node_test.go b/node/pkg/node/node_test.go index a87421c44..cebfc188c 100644 --- a/node/pkg/node/node_test.go +++ b/node/pkg/node/node_test.go @@ -25,6 +25,7 @@ import ( "github.com/certusone/wormhole/node/pkg/common" "github.com/certusone/wormhole/node/pkg/db" "github.com/certusone/wormhole/node/pkg/devnet" + "github.com/certusone/wormhole/node/pkg/processor" gossipv1 "github.com/certusone/wormhole/node/pkg/proto/gossip/v1" publicrpcv1 "github.com/certusone/wormhole/node/pkg/proto/publicrpc/v1" "github.com/certusone/wormhole/node/pkg/readiness" @@ -505,6 +506,10 @@ func TestMain(m *testing.M) { // TestConsensus tests that a set of guardians can form consensus on certain messages and reject certain other messages func TestConsensus(t *testing.T) { + // adjust processor time intervals to make tests pass faster + processor.FirstRetryMinWait = time.Second * 3 + processor.CleanupInterval = time.Second * 1 + const numGuardians = 4 // Quorum will be 3 out of 4 guardians. msgZeroEmitter := someMessage() @@ -556,6 +561,11 @@ func TestConsensus(t *testing.T) { mustReachQuorum: true, performManualReobservationRequest: true, }, + { // Only one Guardian makes the observation while watching and needs to do an automatic re-observation request. + msg: someMessage(), + numGuardiansObserve: 1, + mustReachQuorum: true, + }, { // Message covered by Governor that should pass immediately msg: governedMsg(false), numGuardiansObserve: numGuardians,