Skip to content

Commit b9f6827

Browse files
committed
fix ut
1 parent c0ee93b commit b9f6827

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pkg/fileservice/object_storage_semaphore_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ func TestObjectStorageSemaphoreReleasesOnError(t *testing.T) {
7474
}
7575
sem := newObjectStorageSemaphore(upstream, 1)
7676

77+
// release the blocked write once it has started
78+
go func() {
79+
<-start
80+
close(wait)
81+
}()
82+
7783
err := sem.Write(context.Background(), "a", nil, nil, nil)
7884
require.Error(t, err)
79-
close(wait)
8085

8186
// another call should proceed after the failed one
82-
select {
83-
case start <- struct{}{}:
84-
default:
85-
}
8687
require.NoError(t, sem.Delete(context.Background(), "x"))
8788
}

pkg/fileservice/object_storage_test_helper_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ func (m *mockParallelObjectStorage) WriteMultipartParallel(ctx context.Context,
7272
}
7373

7474
type recordingObjectStorage struct {
75-
dummyObjectStorage
7675
calls []string
7776
ctxs []context.Context
7877
}

0 commit comments

Comments
 (0)