Fix datarace in writecache tests #548
1 changed files with 2 additions and 5 deletions
|
@ -64,8 +64,9 @@ func TestFlush(t *testing.T) {
|
||||||
WithMetabase(mb),
|
WithMetabase(mb),
|
||||||
WithBlobstor(bs),
|
WithBlobstor(bs),
|
||||||
}, opts...)...)
|
}, opts...)...)
|
||||||
|
t.Cleanup(func() { require.NoError(t, wc.Close()) })
|
||||||
require.NoError(t, wc.Open(false))
|
require.NoError(t, wc.Open(false))
|
||||||
initWC(t, wc)
|
require.NoError(t, wc.Init())
|
||||||
|
|
||||||
// First set mode for metabase and blobstor to prevent background flushes.
|
// First set mode for metabase and blobstor to prevent background flushes.
|
||||||
require.NoError(t, mb.SetMode(mode.ReadOnly))
|
require.NoError(t, mb.SetMode(mode.ReadOnly))
|
||||||
|
@ -229,10 +230,6 @@ func newObject(t *testing.T, size int) (*objectSDK.Object, []byte) {
|
||||||
return obj, data
|
return obj, data
|
||||||
}
|
}
|
||||||
|
|
||||||
func initWC(t *testing.T, wc Cache) {
|
|
||||||
require.NoError(t, wc.Init())
|
|
||||||
}
|
|
||||||
|
|
||||||
type dummyEpoch struct{}
|
type dummyEpoch struct{}
|
||||||
|
|
||||||
func (dummyEpoch) CurrentEpoch() uint64 {
|
func (dummyEpoch) CurrentEpoch() uint64 {
|
||||||
|
|
Loading…
Reference in a new issue