3131import org .apache .ratis .util .JavaUtils ;
3232import org .apache .ratis .util .TimeDuration ;
3333import org .junit .jupiter .api .Assertions ;
34+ import org .junit .jupiter .api .Disabled ;
3435import org .junit .jupiter .params .ParameterizedTest ;
35- import org .junit .jupiter .params .provider .MethodSource ;
36+ import org .junit .jupiter .params .provider .ValueSource ;
3637
37- import java .util .Arrays ;
38- import java .util .Collection ;
3938import java .util .concurrent .CompletableFuture ;
4039import java .util .concurrent .TimeUnit ;
4140
@@ -50,28 +49,30 @@ public class TestRaftWithGrpc
5049 SimpleStateMachine4Testing .class , StateMachine .class );
5150 }
5251
53- public static Collection <Boolean []> data () {
54- return Arrays .asList ((new Boolean [][] {{Boolean .FALSE }, {Boolean .TRUE }}));
52+ @ Disabled
53+ @ Override
54+ public void testWithLoad () {
55+ // skip testWithLoad() from parent, called from parameterized testWithLoad(boolean)
5556 }
5657
5758 @ ParameterizedTest
58- @ MethodSource ( "data" )
59- public void testWithLoad (Boolean separateHeartbeat ) throws Exception {
59+ @ ValueSource ( booleans = { true , false } )
60+ public void testWithLoad (boolean separateHeartbeat ) throws Exception {
6061 GrpcConfigKeys .Server .setHeartbeatChannel (getProperties (), separateHeartbeat );
6162 super .testWithLoad ();
6263 BlockRequestHandlingInjection .getInstance ().unblockAll ();
6364 }
6465
6566 @ ParameterizedTest
66- @ MethodSource ( "data" )
67- public void testRequestTimeout (Boolean separateHeartbeat ) throws Exception {
67+ @ ValueSource ( booleans = { true , false } )
68+ public void testRequestTimeout (boolean separateHeartbeat ) throws Exception {
6869 GrpcConfigKeys .Server .setHeartbeatChannel (getProperties (), separateHeartbeat );
6970 runWithNewCluster (NUM_SERVERS , cluster -> testRequestTimeout (false , cluster , LOG ));
7071 }
7172
7273 @ ParameterizedTest
73- @ MethodSource ( "data" )
74- public void testUpdateViaHeartbeat (Boolean separateHeartbeat ) throws Exception {
74+ @ ValueSource ( booleans = { true , false } )
75+ public void testUpdateViaHeartbeat (boolean separateHeartbeat ) throws Exception {
7576 GrpcConfigKeys .Server .setHeartbeatChannel (getProperties (), separateHeartbeat );
7677 runWithNewCluster (NUM_SERVERS , this ::runTestUpdateViaHeartbeat );
7778 }
0 commit comments