Skip to content

Commit

Permalink
samples: increased wait time for undeployed model prediction (#3286)
Browse files Browse the repository at this point in the history
* samples: increased wait time for undeployed model prediction

* fixed the lint issue
  • Loading branch information
munkhuushmgl authored Jul 1, 2020
1 parent f102af8 commit 32173ce
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import java.io.IOException;
import java.io.PrintStream;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -45,7 +48,8 @@ public class PredictionApiIT {
private PrintStream out;

@Before
public void setUp() throws IOException, ExecutionException, InterruptedException {
public void setUp()
throws IOException, ExecutionException, InterruptedException, TimeoutException {
// Verify that the model is deployed for prediction
try (AutoMlClient client = AutoMlClient.create()) {
ModelName modelFullId = ModelName.of(PROJECT_ID, "us-central1", modelId);
Expand All @@ -54,7 +58,8 @@ public void setUp() throws IOException, ExecutionException, InterruptedException
// Deploy the model if not deployed
DeployModelRequest request =
DeployModelRequest.newBuilder().setName(modelFullId.toString()).build();
client.deployModelAsync(request).get();
Future future = client.deployModelAsync(request);
future.get(30, TimeUnit.MINUTES);
}
}

Expand Down

0 comments on commit 32173ce

Please sign in to comment.