Fix datarace in writecache tests #548

Merged
fyrchik merged 2 commits from fyrchik/frostfs-node:fix-writecache into master 2023-07-29 10:57:27 +00:00

View file

@ -64,8 +64,9 @@ func TestFlush(t *testing.T) {
WithMetabase(mb),
WithBlobstor(bs),
}, opts...)...)
t.Cleanup(func() { require.NoError(t, wc.Close()) })
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.
require.NoError(t, mb.SetMode(mode.ReadOnly))
@ -229,10 +230,6 @@ func newObject(t *testing.T, size int) (*objectSDK.Object, []byte) {
return obj, data
}
func initWC(t *testing.T, wc Cache) {
require.NoError(t, wc.Init())
}
type dummyEpoch struct{}
func (dummyEpoch) CurrentEpoch() uint64 {