Skip to content

Commit

Permalink
tests: HeartbeatTime=10s to reduce flakyness
Browse files Browse the repository at this point in the history
Do this for all tests by changing this in TestMain.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
  • Loading branch information
sougou committed Dec 23, 2019
1 parent 1c3d2ff commit 7295237
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions go/vt/vttablet/tabletserver/vstreamer/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"os"
"testing"
"time"

"vitess.io/vitess/go/vt/vttablet/tabletserver/vstreamer/testenv"
)
Expand Down Expand Up @@ -53,6 +54,12 @@ func TestMain(m *testing.M) {
engine.Open(env.KeyspaceName, env.Cells[0])
defer engine.Close()

// GH actions machines sometimes exhibit multi-second delays on replication.
// So, give a generously high value for heartbeat time for all tests.
saveHeartbeat := HeartbeatTime
defer func() { HeartbeatTime = saveHeartbeat }()
HeartbeatTime = 10 * time.Second

return m.Run()
}()
os.Exit(exitCode)
Expand Down

0 comments on commit 7295237

Please sign in to comment.