Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional tests refactoring #6559

Merged
merged 16 commits into from
Oct 2, 2024
13 changes: 7 additions & 6 deletions tests/acquire_shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ import (

"go.temporal.io/server/common/log"
"go.temporal.io/server/common/log/tag"
"go.temporal.io/server/tests/testcore"
)

// AcquireShardFunctionalSuite is the base test suite for testing acquire shard.
// AcquireShardFunctionalSuite is the testcore test suite for testing acquire shard.
type AcquireShardFunctionalSuite struct {
FunctionalTestBase
testcore.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
Loading