Skip to content

Commit da0d72c

Browse files
committed
skip more timing tests with valgrind
1 parent 5d39d37 commit da0d72c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/test-mongoc-topology.c

+9-5
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,9 @@ _test_connect_timeout (bool pooled, bool try_once)
682682
expected_duration_usec += 1000 * (
683683
connect_timeout_ms + MONGOC_TOPOLOGY_MIN_HEARTBEAT_FREQUENCY_MS);
684684

685-
ASSERT_ALMOST_EQUAL (duration_usec, expected_duration_usec);
685+
if (!test_suite_valgrind ()) {
686+
ASSERT_ALMOST_EQUAL (duration_usec, expected_duration_usec);
687+
}
686688

687689
/* single client puts server 0 in cooldown for 5 sec */
688690
if (pooled || !server0_in_cooldown) {
@@ -704,10 +706,12 @@ _test_connect_timeout (bool pooled, bool try_once)
704706

705707
duration_usec = bson_get_monotonic_time () - start;
706708

707-
if (try_once) {
708-
ASSERT_ALMOST_EQUAL (duration_usec / 1000, connect_timeout_ms);
709-
} else {
710-
ASSERT_ALMOST_EQUAL (duration_usec / 1000, server_selection_timeout_ms);
709+
if (!test_suite_valgrind ()) {
710+
if (try_once) {
711+
ASSERT_ALMOST_EQUAL (duration_usec / 1000, connect_timeout_ms);
712+
} else {
713+
ASSERT_ALMOST_EQUAL (duration_usec / 1000, server_selection_timeout_ms);
714+
}
711715
}
712716

713717
if (pooled) {

0 commit comments

Comments
 (0)