MB-21193: Fix ConnectionTest failure when test runs for >21s 73/68273/3
authorDave Rigby <daver@couchbase.com>
Mon, 3 Oct 2016 16:41:14 +0000 (17:41 +0100)
committerDave Rigby <daver@couchbase.com>
Mon, 10 Oct 2016 10:06:54 +0000 (10:06 +0000)
commit74f9b8f9212aa20611ba0e9fb5962a550e58385d
treed86263015f0cf9e2a5fb6dc1cb867faf5e9698aa
parent0a0e32a500d1fb026794d3c6785734a7dc79d4ad
MB-21193: Fix ConnectionTest failure when test runs for >21s

When CV jobs take longer than normal (e.g. when running under
ThreadSanitizer) the ConnectionTest can fail:

    [ RUN      ] ConnectionTest.test_maybesendnoop_buffer_full
    /home/couchbase/jenkins/workspace/ep-engine-threadsanitizer-watson/ep-engine/tests/module_tests/dcp_test.cc:308: Failure
    Value of: ret
      Actual: 255
    Expected: ENGINE_E2BIG
    Which is: 8
    maybeSendNoop not returning ENGINE_E2BIG
    [  FAILED  ] ConnectionTest.test_maybesendnoop_buffer_full (656 ms)

The test is assuming that it starts running in less than 21 seconds
when setting the DCP noop timeout. Instead of using an absolute '21'
we need to use the current_time + 21.

Change-Id: Id4fe8b372da4c447e00128de2c94c72bb60373e4
Reviewed-on: http://review.couchbase.org/68273
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Daniel Owen <owend@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
tests/module_tests/dcp_test.cc