Skip to content

Commit

Permalink
refactor functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ychebotarev committed Sep 23, 2024
1 parent 38c7924 commit 8c132a1
Show file tree
Hide file tree
Showing 73 changed files with 3,441 additions and 3,172 deletions.
11 changes: 6 additions & 5 deletions tests/acquire_shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package tests

import (
"context"
"go.temporal.io/server/tests/base"
"strings"
"time"

Expand All @@ -35,7 +36,7 @@ import (

// AcquireShardFunctionalSuite is the base test suite for testing acquire shard.
type AcquireShardFunctionalSuite struct {
FunctionalTestBase
base.FunctionalTestBase
logRecorder *logRecorder
logs chan logRecord
}
Expand All @@ -51,7 +52,7 @@ func (s *AcquireShardFunctionalSuite) SetupSuite() {
func (s *AcquireShardFunctionalSuite) TearDownSuite() {
// we need to wait for all components to start before we can safely tear down
time.Sleep(time.Second * 5)
s.tearDownSuite()
s.FunctionalTestBase.TearDownSuite()
}

// newLogRecorder creates a new log recorder. It records all the logs to the given channel.
Expand Down Expand Up @@ -109,7 +110,7 @@ type OwnershipLostErrorSuite struct {
// SetupSuite reads the shard ownership lost error fault injection config from the testdata folder.
func (s *OwnershipLostErrorSuite) SetupSuite() {
s.AcquireShardFunctionalSuite.SetupSuite()
s.setupSuite("testdata/acquire_shard_ownership_lost_error.yaml")
s.FunctionalTestBase.SetupSuite("testdata/acquire_shard_ownership_lost_error.yaml")
}

// TestDoesNotRetry verifies that we do not retry acquiring the shard when we get an ownership lost error.
Expand Down Expand Up @@ -151,7 +152,7 @@ type DeadlineExceededErrorSuite struct {
// SetupSuite reads the deadline exceeded error targeted fault injection config from the test data folder.
func (s *DeadlineExceededErrorSuite) SetupSuite() {
s.AcquireShardFunctionalSuite.SetupSuite()
s.setupSuite("testdata/acquire_shard_deadline_exceeded_error.yaml")
s.FunctionalTestBase.SetupSuite("testdata/acquire_shard_deadline_exceeded_error.yaml")
}

// TestDoesRetry verifies that we do retry acquiring the shard when we get a deadline exceeded error because that should
Expand Down Expand Up @@ -193,7 +194,7 @@ type EventualSuccessSuite struct {
// the next call to return a successful response.
func (s *EventualSuccessSuite) SetupSuite() {
s.AcquireShardFunctionalSuite.SetupSuite()
s.setupSuite("testdata/acquire_shard_eventual_success.yaml")
s.FunctionalTestBase.SetupSuite("testdata/acquire_shard_eventual_success.yaml")
}

// TestEventuallySucceeds verifies that we eventually succeed in acquiring the shard when we get a deadline exceeded
Expand Down
Loading

0 comments on commit 8c132a1

Please sign in to comment.