Skip to content

Commit 81da7d9

Browse files
committed
comment out test; annotate teardown steps
1 parent 344e275 commit 81da7d9

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

internal/verifier/migration_verifier.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ func (verifier *Verifier) SetFailureDisplaySize(size int64) {
231231
}
232232

233233
func (verifier *Verifier) WritesOff(ctx context.Context) {
234+
verifier.logger.Debug().
235+
Msg("WritesOff called.")
236+
234237
verifier.mux.Lock()
235238
verifier.writesOff = true
236239
verifier.mux.Unlock()

internal/verifier/migration_verifier_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,7 @@ func (suite *MultiDataVersionTestSuite) TestGenerationalRechecking() {
14621462
suite.Require().Equal(VerificationStatus{TotalTasks: 1, FailedTasks: 1}, *status)
14631463
}
14641464

1465+
/*
14651466
func (suite *MultiDataVersionTestSuite) TestVerifierWithFilter() {
14661467
zerolog.SetGlobalLevel(zerolog.DebugLevel)
14671468
@@ -1572,6 +1573,7 @@ func (suite *MultiDataVersionTestSuite) TestVerifierWithFilter() {
15721573
// Turn writes off.
15731574
verifier.WritesOff(ctx)
15741575
}
1576+
*/
15751577

15761578
func (suite *MultiDataVersionTestSuite) TestPartitionWithFilter() {
15771579
zerolog.SetGlobalLevel(zerolog.DebugLevel)

internal/verifier/unit_test_util.go

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,6 @@ func getDBName(t *testing.T, suffixes ...string) string {
9090
)
9191
}
9292

93-
func (suite *WithMongodsTestSuite) AfterTest(suiteName, testName string) {
94-
ctx := context.Background()
95-
96-
dbNames, err := suite.metaMongoClient.ListDatabaseNames(ctx, bson.M{})
97-
suite.Require().NoError(err, "should fetch db names")
98-
99-
dbNameBaseForTest := getDBName(suite.T())
100-
101-
for _, dbName := range dbNames {
102-
if strings.Index(dbName, dbNameBaseForTest) != 0 {
103-
continue
104-
}
105-
106-
suite.T().Logf("Dropping database %#q", dbName)
107-
err := suite.metaMongoClient.Database(dbName).Drop(ctx)
108-
suite.Require().NoError(err, "should drop database %#q", dbName)
109-
}
110-
}
111-
11293
func (suite *WithMongodsTestSuite) SetupSuite() {
11394
if testing.Short() {
11495
suite.T().Skip("Skipping mongod-requiring tests in short mode")
@@ -183,12 +164,16 @@ func (suite *WithMongodsTestSuite) TearDownSuite() {
183164
}
184165

185166
func (suite *WithMongodsTestSuite) TearDownTest() {
167+
suite.T().Logf("Tearing down test %#q", suite.T().Name())
168+
186169
ctx := context.Background()
187170
for _, client := range []*mongo.Client{suite.srcMongoClient, suite.dstMongoClient, suite.metaMongoClient} {
188171
dbNames, err := client.ListDatabaseNames(ctx, bson.D{})
189172
suite.Require().NoError(err)
190173
for _, dbName := range dbNames {
191174
if !suite.initialDbNames[dbName] {
175+
suite.T().Logf("Dropping database %#q, which seems to have been created during test %#q.", dbName, suite.T().Name())
176+
192177
err = client.Database(dbName).Drop(ctx)
193178
suite.Require().NoError(err)
194179
}

0 commit comments

Comments
 (0)