Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Dec 17, 2024
1 parent 54433aa commit 482e66a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/vt/vtorc/inst/keyspace_dao_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,23 +139,23 @@ func TestDeleteStaleKeyspaces(t *testing.T) {
BaseKeyspace: "baseKeyspace",
},
}
keyspaceInfo.SetKeyspaceName("ks1")
keyspaceInfo.SetKeyspaceName(t.Name())
err := SaveKeyspace(keyspaceInfo)
require.NoError(t, err)

readKeyspaceInfo, err := ReadKeyspace("ks1")
readKeyspaceInfo, err := ReadKeyspace(t.Name())
require.NoError(t, err)
require.NotNil(t, readKeyspaceInfo)

// test a staletime before save causes no delete
require.NoError(t, DeleteStaleKeyspaces(time.Now().Add(-time.Hour)))
readKeyspaceInfo, err = ReadKeyspace("ks1")
readKeyspaceInfo, err = ReadKeyspace(t.Name())
require.NoError(t, err)
require.NotNil(t, readKeyspaceInfo)

// test statetime of now deletes everything
require.NoError(t, DeleteStaleKeyspaces(time.Now()))
readKeyspaceInfo, err = ReadKeyspace("ks1")
readKeyspaceInfo, err = ReadKeyspace(t.Name())
require.Error(t, err)
require.Nil(t, readKeyspaceInfo)
}

0 comments on commit 482e66a

Please sign in to comment.