Skip to content

Commit

Permalink
Merge pull request grpc#7619 from dgquintas/fix_grpclbtest
Browse files Browse the repository at this point in the history
deflake grpclb_test
  • Loading branch information
kpayson64 authored Aug 3, 2016
2 parents d924b01 + 5d96056 commit 1e6e21b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3154,6 +3154,7 @@ LIBGRPC_TEST_UTIL_SRC = \
src/core/lib/transport/metadata.c \
src/core/lib/transport/metadata_batch.c \
src/core/lib/transport/static_metadata.c \
src/core/lib/transport/timeout_encoding.c \
src/core/lib/transport/transport.c \
src/core/lib/transport/transport_op_string.c \

Expand Down
11 changes: 6 additions & 5 deletions test/cpp/grpclb/grpclb_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,12 @@ int main(int argc, char **argv) {
// If the LB server waits > 2000ms, the update arrives after the first two
// request are done and the third pick is performed, which returns, in RR
// fashion, the 1st server of the 1st update. Therefore, the second server of
// batch 1 is hit twice, whereas the first server of batch 2 is never hit.
tf_result = grpc::test_update(2100);
GPR_ASSERT(tf_result.lb_backends[0].num_calls_serviced == 2);
GPR_ASSERT(tf_result.lb_backends[1].num_calls_serviced == 1);
GPR_ASSERT(tf_result.lb_backends[2].num_calls_serviced == 1);
// batch 1 is hit at least one, whereas the first server of batch 2 is never
// hit.
tf_result = grpc::test_update(2500);
GPR_ASSERT(tf_result.lb_backends[0].num_calls_serviced >= 1);
GPR_ASSERT(tf_result.lb_backends[1].num_calls_serviced > 0);
GPR_ASSERT(tf_result.lb_backends[2].num_calls_serviced > 0);
GPR_ASSERT(tf_result.lb_backends[3].num_calls_serviced == 0);

grpc_shutdown();
Expand Down
3 changes: 3 additions & 0 deletions vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
<ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\metadata.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\metadata_batch.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\static_metadata.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\timeout_encoding.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\transport.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\transport_impl.h" />
</ItemGroup>
Expand Down Expand Up @@ -476,6 +477,8 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\lib\transport\static_metadata.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\lib\transport\timeout_encoding.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\lib\transport\transport.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\lib\transport\transport_op_string.c">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@
<ClCompile Include="$(SolutionDir)\..\src\core\lib\transport\static_metadata.c">
<Filter>src\core\lib\transport</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\lib\transport\timeout_encoding.c">
<Filter>src\core\lib\transport</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\lib\transport\transport.c">
<Filter>src\core\lib\transport</Filter>
</ClCompile>
Expand Down Expand Up @@ -671,6 +674,9 @@
<ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\static_metadata.h">
<Filter>src\core\lib\transport</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\timeout_encoding.h">
<Filter>src\core\lib\transport</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\transport.h">
<Filter>src\core\lib\transport</Filter>
</ClInclude>
Expand Down

0 comments on commit 1e6e21b

Please sign in to comment.