[Test Code]: Teardown StreamTest class correctly 44/77344/5
authorManu Dhundi <manu@couchbase.com>
Tue, 25 Apr 2017 21:31:41 +0000 (14:31 -0700)
committerManu Dhundi <manu@couchbase.com>
Wed, 26 Apr 2017 19:37:45 +0000 (19:37 +0000)
During the teardown, only cleanup the objects that were created.

Change-Id: I065ee367013d9f9c8faafe484c13de34003fb8c5
Reviewed-on: http://review.couchbase.org/77344
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
tests/module_tests/dcp_test.cc

index 875884b..d9d6e02 100644 (file)
@@ -98,7 +98,9 @@ protected:
     }
 
     void TearDown() override {
-        producer->clearCheckpointProcessorTaskQueues();
+        if (producer) {
+            producer->clearCheckpointProcessorTaskQueues();
+        }
         // Destroy various engine objects
         vb0.reset();
         stream.reset();
@@ -451,10 +453,7 @@ TEST_P(StreamTest, BackfillOnly) {
 TEST_P(StreamTest, BackfillFail) {
     if (bucketType == "persistent") {
         /* This test simulates a backfill failure for an ephemeral bucket
-           only.
-           [TODO]: Write a test case for disk backfill failures as well */
-        setup_dcp_stream(); /* [TODO, Legacy]: Check why TearDown() crashes
-                                               without this */
+           only. */
         return;
     }