Skip to content

Commit f1ccdba

Browse files
authored
Avoid Database Replicator Failures (#4214)
* Avoid Database Replicator Failures * Clean up backup DB and replication doc before test runs
1 parent ff08ff5 commit f1ccdba

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/src/test/scala/org/apache/openwhisk/core/database/test/ReplicatorTests.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,18 @@ class ReplicatorTests
350350
it should "continuously update a database" in {
351351
// Create a database to backup
352352
val dbName = testDbPrefix + "database_for_continous_replication"
353+
val backupDbName = s"continuous_$dbName"
354+
355+
// Pre-test cleanup of previously created entities
356+
removeDatabase(backupDbName, true)
357+
removeReplicationDoc(backupDbName)
358+
353359
val client = createDatabase(dbName, Some(designDocPath))
354360

355361
// Trigger replication and verify the created databases have the correct format
356362
val (createdBackupDbs, _, _) = runReplicator(dbUrl, dbUrl, testDbPrefix, 10.minutes, continuous = true)
357363
createdBackupDbs should have size 1
358-
val backupDbName = createdBackupDbs.head
359-
backupDbName shouldBe s"continuous_$dbName"
364+
createdBackupDbs.head shouldBe backupDbName
360365

361366
// Wait for the replicated database to appear
362367
val backupClient = waitForDatabase(backupDbName)

0 commit comments

Comments
 (0)