Skip to content

Commit

Permalink
fix logger test and locker test
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRoesler committed Nov 14, 2023
1 parent 17ea8ca commit 66caa1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func TestNewLogger(t *testing.T) {
"error",
LogLevelError,
},
{
"Less than error",
-1,
},
}

for _, tt := range tests {
Expand Down
4 changes: 2 additions & 2 deletions scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ func (t *testLocker) Lock(_ context.Context, _ string) (Lock, error) {
if t.jobLocked {
return nil, fmt.Errorf("job already locked")
}
t.jobLocked = true
return &testLock{}, nil
}

Expand Down Expand Up @@ -1056,15 +1057,14 @@ func TestScheduler_WithDistributed(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
elector := &testElector{}
jobsRan := make(chan struct{}, 20)
ctx, cancel := context.WithCancel(context.Background())
schedulersDone := make(chan struct{}, tt.count)

for i := tt.count; i > 0; i-- {
go func() {
s, err := newTestScheduler(
WithDistributedElector(elector),
tt.opt,
)
require.NoError(t, err)

Expand Down

0 comments on commit 66caa1a

Please sign in to comment.