Skip to content

Commit

Permalink
simplify tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Feb 11, 2025
1 parent 7dd6da1 commit 89031a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 3 additions & 4 deletions go/vt/vtorc/inst/cell_dao_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ import (
)

func TestSaveReadAndDeleteCells(t *testing.T) {
// Clear the database after the test. The easiest way to do that is to run all the initialization commands again.
defer func() {
db.ClearVTOrcDatabase()
}()
db.ClearVTOrcDatabase()
defer db.ClearVTOrcDatabase()

cells := []string{"zone1", "zone2", "zone3"}
for _, cell := range cells {
require.NoError(t, SaveCell(cell))
Expand Down
8 changes: 2 additions & 6 deletions go/vt/vtorc/logic/cell_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@ import (
)

func TestRefreshCells(t *testing.T) {
// Store the old flags and restore on test completion
oldTs := ts
defer func() {
ts = oldTs
}()

db.ClearVTOrcDatabase()
oldTs := ts
defer func() {
db.ClearVTOrcDatabase()
ts = oldTs
}()

cells := []string{"zone1", "zone2", "zone3"}
Expand Down

0 comments on commit 89031a3

Please sign in to comment.