This is an automated email from the ASF dual-hosted git repository.

dubeejw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new f1ccdba  Avoid Database Replicator Failures (#4214)
f1ccdba is described below

commit f1ccdbab67f0bbea19f1f1d6213eb4f1ed1da7b2
Author: James Dubee <[email protected]>
AuthorDate: Thu Jan 17 12:50:19 2019 -0500

    Avoid Database Replicator Failures (#4214)
    
    * Avoid Database Replicator Failures
    
    * Clean up backup DB and replication doc before test runs
---
 .../apache/openwhisk/core/database/test/ReplicatorTests.scala    | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/tests/src/test/scala/org/apache/openwhisk/core/database/test/ReplicatorTests.scala
 
b/tests/src/test/scala/org/apache/openwhisk/core/database/test/ReplicatorTests.scala
index 681ee99..5f1bdad 100644
--- 
a/tests/src/test/scala/org/apache/openwhisk/core/database/test/ReplicatorTests.scala
+++ 
b/tests/src/test/scala/org/apache/openwhisk/core/database/test/ReplicatorTests.scala
@@ -350,13 +350,18 @@ class ReplicatorTests
   it should "continuously update a database" in {
     // Create a database to backup
     val dbName = testDbPrefix + "database_for_continous_replication"
+    val backupDbName = s"continuous_$dbName"
+
+    // Pre-test cleanup of previously created entities
+    removeDatabase(backupDbName, true)
+    removeReplicationDoc(backupDbName)
+
     val client = createDatabase(dbName, Some(designDocPath))
 
     // Trigger replication and verify the created databases have the correct 
format
     val (createdBackupDbs, _, _) = runReplicator(dbUrl, dbUrl, testDbPrefix, 
10.minutes, continuous = true)
     createdBackupDbs should have size 1
-    val backupDbName = createdBackupDbs.head
-    backupDbName shouldBe s"continuous_$dbName"
+    createdBackupDbs.head shouldBe backupDbName
 
     // Wait for the replicated database to appear
     val backupClient = waitForDatabase(backupDbName)

Reply via email to