Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void givenCallerThrowsQuotaException_emitsIntoFailurePCollection() {

@Test
public void givenCallerTimeout_emitsFailurePCollection() {
Duration timeout = Duration.standardMinutes(1L);
Duration timeout = Duration.standardSeconds(1L);
Result<Response> result =
pipeline
.apply(Create.of(new Request("a")))
Expand Down Expand Up @@ -182,8 +182,7 @@ public void givenSetupThrowsQuotaException_throwsError() {

@Test
public void givenSetupTimeout_throwsError() {
Duration timeout = Duration.standardMinutes(1L);

Duration timeout = Duration.standardSeconds(1L);
pipeline
.apply(Create.of(new Request("")))
.apply(
Expand Down Expand Up @@ -231,7 +230,7 @@ public void givenTeardownThrowsQuotaException_throwsError() {

@Test
public void givenTeardownTimeout_throwsError() {
Duration timeout = Duration.standardMinutes(1L);
Duration timeout = Duration.standardSeconds(1L);
pipeline
.apply(Create.of(new Request("")))
.apply(
Expand Down Expand Up @@ -271,7 +270,7 @@ public void givenValidCaller_emitValidResponse() {
private static class ValidCaller implements Caller<Request, Response> {

@Override
public Response call(Request request) throws UserCodeExecutionException {
public Response call(Request request) {
return new Response(request.id);
}
}
Expand All @@ -282,7 +281,7 @@ private static class UnSerializableCaller implements Caller<Request, Response> {
private final UnSerializable nestedThing = new UnSerializable();

@Override
public Response call(Request request) throws UserCodeExecutionException {
public Response call(Request request) {
return new Response(request.id);
}
}
Expand All @@ -291,10 +290,10 @@ private static class UnSerializableCallerWithSetupTeardown extends UnSerializabl
implements SetupTeardown {

@Override
public void setup() throws UserCodeExecutionException {}
public void setup() {}

@Override
public void teardown() throws UserCodeExecutionException {}
public void teardown() {}
}

private static class UnSerializable {}
Expand Down Expand Up @@ -358,11 +357,11 @@ private static class CallerExceedsTimeout implements Caller<Request, Response> {
private final Duration timeout;

CallerExceedsTimeout(Duration timeout) {
this.timeout = timeout.plus(Duration.standardSeconds(1L));
this.timeout = timeout.plus(Duration.standardSeconds(10L));
}

@Override
public Response call(Request request) throws UserCodeExecutionException {
public Response call(Request request) {
sleep(timeout);
return new Response(request.id);
}
Expand Down Expand Up @@ -397,16 +396,16 @@ private static class SetupExceedsTimeout implements SetupTeardown {
private final Duration timeout;

private SetupExceedsTimeout(Duration timeout) {
this.timeout = timeout.plus(Duration.standardSeconds(1L));
this.timeout = timeout.plus(Duration.standardSeconds(10L));
}

@Override
public void setup() throws UserCodeExecutionException {
public void setup() {
sleep(timeout);
}

@Override
public void teardown() throws UserCodeExecutionException {}
public void teardown() {}
}

private static class SetupThrowsUserCodeExecutionException implements SetupTeardown {
Expand All @@ -416,7 +415,7 @@ public void setup() throws UserCodeExecutionException {
}

@Override
public void teardown() throws UserCodeExecutionException {}
public void teardown() {}
}

private static class SetupThrowsUserCodeQuotaException implements SetupTeardown {
Expand All @@ -426,7 +425,7 @@ public void setup() throws UserCodeExecutionException {
}

@Override
public void teardown() throws UserCodeExecutionException {}
public void teardown() {}
}

private static class SetupThrowsUserCodeTimeoutException implements SetupTeardown {
Expand All @@ -436,28 +435,28 @@ public void setup() throws UserCodeExecutionException {
}

@Override
public void teardown() throws UserCodeExecutionException {}
public void teardown() {}
}

private static class TeardownExceedsTimeout implements SetupTeardown {
private final Duration timeout;

private TeardownExceedsTimeout(Duration timeout) {
this.timeout = timeout.plus(Duration.standardSeconds(1L));
this.timeout = timeout.plus(Duration.standardSeconds(10L));
}

@Override
public void setup() throws UserCodeExecutionException {}
public void setup() {}

@Override
public void teardown() throws UserCodeExecutionException {
public void teardown() {
sleep(timeout);
}
}

private static class TeardownThrowsUserCodeExecutionException implements SetupTeardown {
@Override
public void setup() throws UserCodeExecutionException {}
public void setup() {}

@Override
public void teardown() throws UserCodeExecutionException {
Expand All @@ -467,7 +466,7 @@ public void teardown() throws UserCodeExecutionException {

private static class TeardownThrowsUserCodeQuotaException implements SetupTeardown {
@Override
public void setup() throws UserCodeExecutionException {}
public void setup() {}

@Override
public void teardown() throws UserCodeExecutionException {
Expand All @@ -477,7 +476,7 @@ public void teardown() throws UserCodeExecutionException {

private static class TeardownThrowsUserCodeTimeoutException implements SetupTeardown {
@Override
public void setup() throws UserCodeExecutionException {}
public void setup() {}

@Override
public void teardown() throws UserCodeExecutionException {
Expand Down Expand Up @@ -519,14 +518,12 @@ private static class DeterministicRequestCoder extends CustomCoder<@NonNull Requ
private static final Coder<String> ID_CODER = StringUtf8Coder.of();

@Override
public void encode(Request value, @NotNull OutputStream outStream)
throws CoderException, IOException {
public void encode(Request value, @NotNull OutputStream outStream) throws IOException {
ID_CODER.encode(checkStateNotNull(value).id, outStream);
}

@Override
public @NonNull Request decode(@NotNull InputStream inStream)
throws CoderException, IOException {
public @NonNull Request decode(@NotNull InputStream inStream) throws IOException {
String id = ID_CODER.decode(inStream);
return new Request(id);
}
Expand All @@ -542,7 +539,7 @@ private static class DeterministicResponseCoder extends CustomCoder<Response> {

@Override
public void encode(@Nullable Response value, @NotNull OutputStream outStream)
throws CoderException, IOException {
throws IOException {
if (value == null) {
ID_CODER.encode(null, outStream);
return;
Expand All @@ -551,7 +548,7 @@ public void encode(@Nullable Response value, @NotNull OutputStream outStream)
}

@Override
public Response decode(@NotNull InputStream inStream) throws CoderException, IOException {
public Response decode(@NotNull InputStream inStream) throws IOException {
try {
String id = ID_CODER.decode(inStream);
return new Response(id);
Expand Down
Loading