Skip to content

Commit

Permalink
set time
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
timvaillancourt committed Oct 5, 2024
1 parent 42ce0f5 commit 2038df5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/vt/discovery/healthcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func TestHealthCheck(t *testing.T) {
input := make(chan *querypb.StreamHealthResponse)
conn := createFakeConn(tablet, input)
now := time.Now()
hc.nowTimeFunc = func() time.Time { return now }

// create a channel and subscribe to healthcheck
resultChan := hc.Subscribe()
Expand Down Expand Up @@ -497,6 +498,7 @@ func TestHealthCheckErrorOnPrimaryAfterExternalReparent(t *testing.T) {
Serving: true,
Stats: &querypb.RealtimeStats{ReplicationLagSeconds: 0, CpuUsage: 0.2},
PrimaryTermStartTime: 20,
Timestamp: protoutil.TimeToProto(now),
}}
a = hc.GetHealthyTabletStats(&querypb.Target{Keyspace: "k", Shard: "s", TabletType: topodatapb.TabletType_PRIMARY})
mustMatch(t, health, a, "unexpected result")
Expand Down

0 comments on commit 2038df5

Please sign in to comment.