14
14
#undef MONGOC_LOG_DOMAIN
15
15
#define MONGOC_LOG_DOMAIN "topology-test"
16
16
17
+ static int should_run_topology_tests (void )
18
+ {
19
+ if (getenv ("FOREVER_GREEN" )) {
20
+ return 0 ;
21
+ }
22
+ return 1 ;
23
+ }
17
24
18
25
static void
19
26
test_topology_client_creation (void )
@@ -231,13 +238,13 @@ _test_server_selection (bool try_once)
231
238
}
232
239
233
240
static void
234
- test_server_selection_try_once (void )
241
+ test_server_selection_try_once (void * context )
235
242
{
236
243
_test_server_selection (true);
237
244
}
238
245
239
246
static void
240
- test_server_selection_try_once_false (void )
247
+ test_server_selection_try_once_false (void * context )
241
248
{
242
249
_test_server_selection (false);
243
250
}
@@ -671,21 +678,21 @@ _test_connect_timeout (bool pooled, bool try_once)
671
678
672
679
673
680
static void
674
- test_connect_timeout_pooled (void )
681
+ test_connect_timeout_pooled (void * context )
675
682
{
676
683
_test_connect_timeout (true, false);
677
684
}
678
685
679
686
680
687
static void
681
- test_connect_timeout_single (void )
688
+ test_connect_timeout_single (void * context )
682
689
{
683
690
_test_connect_timeout (false, true);
684
691
}
685
692
686
693
687
694
static void
688
- test_connect_timeout_try_once_false (void )
695
+ test_connect_timeout_try_once_false (void * context )
689
696
{
690
697
_test_connect_timeout (false, false);
691
698
}
@@ -697,14 +704,14 @@ test_topology_install (TestSuite *suite)
697
704
TestSuite_Add (suite , "/Topology/client_creation" , test_topology_client_creation );
698
705
TestSuite_Add (suite , "/Topology/client_pool_creation" , test_topology_client_pool_creation );
699
706
TestSuite_Add (suite , "/Topology/server_selection_try_once_option" , test_server_selection_try_once_option );
700
- TestSuite_Add (suite , "/Topology/server_selection_try_once" , test_server_selection_try_once );
701
- TestSuite_Add (suite , "/Topology/server_selection_try_once_false" , test_server_selection_try_once_false );
707
+ TestSuite_AddFull (suite , "/Topology/server_selection_try_once" , test_server_selection_try_once , NULL , NULL , should_run_topology_tests );
708
+ TestSuite_AddFull (suite , "/Topology/server_selection_try_once_false" , test_server_selection_try_once_false , NULL , NULL , should_run_topology_tests );
702
709
TestSuite_Add (suite , "/Topology/invalidate_server" , test_topology_invalidate_server );
703
710
TestSuite_Add (suite , "/Topology/invalid_cluster_node" , test_invalid_cluster_node );
704
711
TestSuite_Add (suite , "/Topology/max_wire_version_race_condition" , test_max_wire_version_race_condition );
705
712
TestSuite_Add (suite , "/Topology/cooldown/standalone" , test_cooldown_standalone );
706
713
TestSuite_Add (suite , "/Topology/cooldown/rs" , test_cooldown_rs );
707
- TestSuite_Add (suite , "/Topology/connect_timeout/pooled" , test_connect_timeout_pooled );
708
- TestSuite_Add (suite , "/Topology/connect_timeout/single/try_once" , test_connect_timeout_single );
709
- TestSuite_Add (suite , "/Topology/connect_timeout/single/try_once_false" , test_connect_timeout_try_once_false );
714
+ TestSuite_AddFull (suite , "/Topology/connect_timeout/pooled" , test_connect_timeout_pooled , NULL , NULL , should_run_topology_tests );
715
+ TestSuite_AddFull (suite , "/Topology/connect_timeout/single/try_once" , test_connect_timeout_single , NULL , NULL , should_run_topology_tests );
716
+ TestSuite_AddFull (suite , "/Topology/connect_timeout/single/try_once_false" , test_connect_timeout_try_once_false , NULL , NULL , should_run_topology_tests );
710
717
}
0 commit comments