Fix race in exp tidy test

This commit is contained in:
Jeff Mitchell 2018-07-06 17:01:02 -04:00
parent 25d9341df0
commit 3885365757

View file

@ -38,14 +38,17 @@ func mockBackendExpiration(t testing.TB, backend physical.Backend) (*Core, *Expi
func TestExpiration_Tidy(t *testing.T) { func TestExpiration_Tidy(t *testing.T) {
var err error var err error
exp := mockExpiration(t)
// We use this later for tidy testing where we need to check the output // We use this later for tidy testing where we need to check the output
logOut := new(bytes.Buffer) logOut := new(bytes.Buffer)
logger := log.New(&log.LoggerOptions{ logger := log.New(&log.LoggerOptions{
Output: logOut, Output: logOut,
}) })
exp.logger = logger
testCore := TestCore(t)
testCore.logger = logger
testCoreUnsealed(t, testCore)
exp := testCore.expiration
if err := exp.Restore(nil); err != nil { if err := exp.Restore(nil); err != nil {
t.Fatal(err) t.Fatal(err)