File tree 1 file changed +18
-6
lines changed
interop-testing/src/main/java/io/grpc/testing/integration
1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -1765,19 +1765,31 @@ public void testOrcaOob() throws Exception {
1765
1765
.putUtilization ("util" , 0.30499 )
1766
1766
.build ();
1767
1767
blockingStub .unaryCall (SimpleRequest .newBuilder ().setOrcaOobReport (answer ).build ());
1768
- Thread .sleep (1500 );
1769
- blockingStub .withOption (ORCA_OOB_REPORT_KEY , reportHolder ).emptyCall (EMPTY );
1770
- assertThat (reportHolder .get ()).isEqualTo (answer );
1768
+ int i ;
1769
+ int retryLimit = 5 ;
1770
+ for (i = 0 ; i < retryLimit ; i ++) {
1771
+ Thread .sleep (1000 );
1772
+ blockingStub .withOption (ORCA_OOB_REPORT_KEY , reportHolder ).emptyCall (EMPTY );
1773
+ if (reportHolder .get ().equals (answer )) {
1774
+ break ;
1775
+ }
1776
+ }
1777
+ assertThat (i ).isLessThan (retryLimit );
1771
1778
1772
1779
answer = TestOrcaReport .newBuilder ()
1773
1780
.setCpuUtilization (0.29309 )
1774
1781
.setMemoryUtilization (0.2 )
1775
1782
.putUtilization ("util" , 100.2039 )
1776
1783
.build ();
1777
1784
blockingStub .unaryCall (SimpleRequest .newBuilder ().setOrcaOobReport (answer ).build ());
1778
- Thread .sleep (1500 );
1779
- blockingStub .withOption (ORCA_OOB_REPORT_KEY , reportHolder ).emptyCall (EMPTY );
1780
- assertThat (reportHolder .get ()).isEqualTo (answer );
1785
+ for (i = 0 ; i < retryLimit ; i ++) {
1786
+ Thread .sleep (1000 );
1787
+ blockingStub .withOption (ORCA_OOB_REPORT_KEY , reportHolder ).emptyCall (EMPTY );
1788
+ if (reportHolder .get ().equals (answer )) {
1789
+ break ;
1790
+ }
1791
+ }
1792
+ assertThat (i ).isLessThan (retryLimit );
1781
1793
}
1782
1794
1783
1795
/** Sends a large unary rpc with service account credentials. */
You can’t perform that action at this time.
0 commit comments