[BP] MB-17766: Fix intermittant stream_test failure 58/60058/2
authorDave Rigby <daver@couchbase.com>
Tue, 16 Feb 2016 12:54:38 +0000 (12:54 +0000)
committerChiyoung Seo <chiyoung@couchbase.com>
Tue, 16 Feb 2016 23:24:04 +0000 (23:24 +0000)
Address two issues:

1) end sequence numbers were incorrect, which could result in not
   having any items in our cursor.
2) Don't check CheckpointMamager::registerCursor() return falue, we
   don't actually care if any other cursors are already registered for
   a given checkpoint (persistence cursor sometimes registers before
   us).

Change-Id: I1145d5fb61c0c12f019154c979afdd50b4060509
Reviewed-on: http://review.couchbase.org/60058
Tested-by: buildbot <build@couchbase.com>
Well-Formed: Hari Kodungallur <hari.kodungallur@couchbase.com>
Well-Formed: buildbot <build@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
tests/module_tests/stream_test.cc

index c8abdc9..291a41a 100644 (file)
@@ -99,19 +99,18 @@ static void test_mb17766(const std::string& test_dbname) {
                                               /*notifyOnly*/false);
     ExTask task = new ActiveStreamCheckpointProcessorTask(*engine);
     stream_t stream = new MockActiveStream(engine, producer,
-                                           "test_mb17766", /*flags*/0,
+                                           producer->getName(),
+                                           /*flags*/0,
                                             /*opaque*/0, vbid,
                                             /*st_seqno*/0,
-                                            /*en_seqno*/0,
+                                            /*en_seqno*/~0,
                                             /*vb_uuid*/0xabcd,
                                             /*snap_start_seqno*/0,
-                                            /*snap_end_seqno*/0, task);
+                                            /*snap_end_seqno*/~0, task);
 
     RCPtr<VBucket> vb0 = engine->getVBucket(0);
     EXPECT_EQ(true, vb0, "Failed to get valid VBucket object for id 0");
-    EXPECT_EQ(false,
-              vb0->checkpointManager.registerTAPCursor("test_mb17766"),
-              "Found an existing TAP cursor when attemping to register ours");
+    vb0->checkpointManager.registerTAPCursor(producer->getName());
 
     // Should start with nextCheckpointItem() returning true.
     MockActiveStream* mock_stream = static_cast<MockActiveStream*>(stream.get());