diff options
author | 2017-07-13 00:00:27 +0200 | |
---|---|---|
committer | 2017-07-13 09:56:57 +0200 | |
commit | 60eb53bca7348edebdb2b8e6734f6b748e990ec7 (patch) | |
tree | ec02a6d820b4a11ee82a0e32b12c8d8b83c9bec8 /src/test/java/com/google/devtools/build/lib/remote/RetrierTest.java | |
parent | f626144b6fd245fcf0f793e18dda513b2263a7a7 (diff) |
Fixing the handling of retries for watch and execute calls.
TESTED=remote worker, triggered some errors
RELNOTES: fixes #3305, helps #3356
PiperOrigin-RevId: 161722997
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/remote/RetrierTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/remote/RetrierTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/remote/RetrierTest.java b/src/test/java/com/google/devtools/build/lib/remote/RetrierTest.java index 9a8e464914..d55e2b659d 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/RetrierTest.java +++ b/src/test/java/com/google/devtools/build/lib/remote/RetrierTest.java @@ -19,6 +19,7 @@ import static org.mockito.Mockito.when; import com.google.common.collect.Range; import io.grpc.Status; +import io.grpc.StatusRuntimeException; import java.io.IOException; import java.time.Duration; import org.junit.Before; @@ -124,6 +125,19 @@ public class RetrierTest { } @Test + public void testPassThroughException() throws Exception { + StatusRuntimeException thrown = Status.Code.UNKNOWN.toStatus().asRuntimeException(); + try { + Retrier.NO_RETRIES.execute(() -> { + throw new Retrier.PassThroughException(thrown); + }); + fail(); + } catch (StatusRuntimeException expected) { + assertThat(expected).isSameAs(thrown); + } + } + + @Test public void testIOExceptionIsPassedThrough() throws Exception { IOException thrown = new IOException(); try { |