Skip to content

Commit 938331f

Browse files
committed
fix tests
1 parent 9506f3d commit 938331f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

internal/cmd/startall_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
func TestStartAllCommand(t *testing.T) {
1313
t.Run("StartAll", func(t *testing.T) {
14-
th := test.SetupCommand(t)
14+
th := test.SetupCommand(t, test.WithCoordinatorEnabled())
1515
go func() {
1616
time.Sleep(time.Millisecond * 500)
1717
th.Cancel()

internal/test/helper.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ func WithServerConfig(cfg *config.Server) HelperOption {
7272
}
7373
}
7474

75+
// WithCoordinatorEnabled re-enables the coordinator in test configuration.
76+
// By default, tests disable the coordinator since no coordinator is running.
77+
func WithCoordinatorEnabled() HelperOption {
78+
return WithConfigMutator(func(cfg *config.Config) {
79+
cfg.Coordinator.Enabled = true
80+
})
81+
}
82+
7583
// WithConfigMutator applies mutations to the loaded configuration after defaults are set.
7684
func WithConfigMutator(mutator func(*config.Config)) HelperOption {
7785
return func(opts *Options) {

0 commit comments

Comments
 (0)