File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
xds/src/test/java/io/grpc/xds Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -932,7 +932,7 @@ public void testAllZeroWeightsUseOne() {
932932
933933 @ Test
934934 public void testAllInvalidWeightsUseOne () {
935- float [] weights = {-1.0f , -0.0f , 0.0f };
935+ float [] weights = {-3.1f , -0.0f , 0.0f };
936936 StaticStrideScheduler sss = new StaticStrideScheduler (weights );
937937 int [] expectedPicks = new int [] {2 , 2 , 2 };
938938 int [] picks = new int [3 ];
@@ -1023,7 +1023,17 @@ public void testStaticStrideSchedulerNonIntegers2() {
10231023 // sss and edf have diff behaviors?
10241024 }
10251025
1026-
1026+ @ Test
1027+ public void testTwoWeights () {
1028+ float [] weights = {1.0f , 2.0f };
1029+ StaticStrideScheduler sss = new StaticStrideScheduler (weights );
1030+ assertThat (sss .pickChannel ()).isEqualTo (1 );
1031+ assertThat (sss .pickChannel ()).isEqualTo (0 );
1032+ assertThat (sss .pickChannel ()).isEqualTo (1 );
1033+ assertThat (sss .pickChannel ()).isEqualTo (1 );
1034+ assertThat (sss .pickChannel ()).isEqualTo (0 );
1035+ assertThat (sss .pickChannel ()).isEqualTo (1 );
1036+ }
10271037
10281038 private static class FakeSocketAddress extends SocketAddress {
10291039 final String name ;
You can’t perform that action at this time.
0 commit comments