cbickel commented on a change in pull request #2600: Remove databases of old 
ReplicatorTests that failed
URL: 
https://github.com/apache/incubator-openwhisk/pull/2600#discussion_r132475988
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/database/test/ReplicatorTests.scala
 ##########
 @@ -130,6 +130,17 @@ class ReplicatorTests extends FlatSpec
         }
     }
 
+    // Do cleanups of possibly existing databases
+    val dbs = replicatorClient.dbs().futureValue
+    dbs shouldBe 'right
+    dbs.right.get.filter(dbname => dbname.contains(testDbPrefix)).map(dbName 
=> removeDatabase(dbName))
+
+    val docs = replicatorClient.getAllDocs().futureValue
+    docs shouldBe 'right
+    docs.right.get.fields("rows").convertTo[List[JsObject]]
+        .filter(_.fields("id").convertTo[String].contains(testDbPrefix))
 
 Review comment:
   The problem is, that the test creates databases with the prefix 
"continous_testDbPrefix", "backup_timestamp_testDbPrefix" and "testDbPrefix".
   The testDbPrefix is already a combination of the string "replicatorTests" 
and the dbPrefix of the environment.
   That's why I just use contains instead of handling all cases.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to