From 2ef8a3b66ba9c861da613d3a34754519fcaf156d Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Mon, 20 Jan 2025 14:28:52 +1100 Subject: [PATCH] chore: mark some tests as slow --- internal/buildengine/engine_test.go | 3 +++ internal/raft/cluster_test.go | 12 ++++++++++++ internal/raft/eventview_test.go | 3 +++ 3 files changed, 18 insertions(+) diff --git a/internal/buildengine/engine_test.go b/internal/buildengine/engine_test.go index 0e304a0b44..441fa569f3 100644 --- a/internal/buildengine/engine_test.go +++ b/internal/buildengine/engine_test.go @@ -16,6 +16,9 @@ import ( ) func TestGraph(t *testing.T) { + if testing.Short() { + t.SkipNow() + } ctx, cancel := context.WithCancel(log.ContextWithNewDefaultLogger(context.Background())) t.Cleanup(cancel) projConfig := projectconfig.Config{ diff --git a/internal/raft/cluster_test.go b/internal/raft/cluster_test.go index c454572470..771d228471 100644 --- a/internal/raft/cluster_test.go +++ b/internal/raft/cluster_test.go @@ -48,6 +48,9 @@ func (s *IntStateMachine) Save(writer io.Writer) error { return nil } func (s *IntStateMachine) Close() error { return nil } func TestClusterWith2Shards(t *testing.T) { + if testing.Short() { + t.SkipNow() + } ctx := testContext(t) _, shards := startClusters(ctx, t, 2, func(b *raft.Builder) []sm.Handle[int64, int64, IntEvent] { @@ -68,6 +71,9 @@ func TestClusterWith2Shards(t *testing.T) { } func TestJoiningExistingCluster(t *testing.T) { + if testing.Short() { + t.SkipNow() + } ctx := testContext(t) addresses, err := local.FreeTCPAddresses(5) @@ -124,6 +130,9 @@ func TestJoiningExistingCluster(t *testing.T) { } func TestLeavingCluster(t *testing.T) { + if testing.Short() { + t.SkipNow() + } ctx := testContext(t) clusters, shards := startClusters(ctx, t, 3, func(b *raft.Builder) sm.Handle[int64, int64, IntEvent] { @@ -143,6 +152,9 @@ func TestLeavingCluster(t *testing.T) { } func TestStateIter(t *testing.T) { + if testing.Short() { + t.SkipNow() + } ctx := testContext(t) _, shards := startClusters(ctx, t, 2, func(b *raft.Builder) sm.Handle[int64, int64, IntEvent] { diff --git a/internal/raft/eventview_test.go b/internal/raft/eventview_test.go index 785db7ef9c..d7adecfd0f 100644 --- a/internal/raft/eventview_test.go +++ b/internal/raft/eventview_test.go @@ -40,6 +40,9 @@ func (v *IntSumView) UnmarshalBinary(data []byte) error { } func TestEventView(t *testing.T) { + if testing.Short() { + t.SkipNow() + } ctx := testContext(t) _, views := startClusters(ctx, t, 2, func(b *raft.Builder) eventstream.EventView[IntSumView, IntStreamEvent] {