File tree Expand file tree Collapse file tree
google-cloud-storage/src/test
java/com/google/cloud/storage/it/runner/registry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ public final class TestBench implements ManagedLifecycle {
106106 private Path outPath ;
107107 private Path errPath ;
108108
109+ private boolean runningOutsideAlready ;
110+
109111 private TestBench (
110112 boolean ignorePullError ,
111113 String baseUri ,
@@ -199,6 +201,14 @@ public Object get() {
199201
200202 @ Override
201203 public void start () {
204+ try {
205+ listRetryTests ();
206+ LOGGER .info ("Using testbench running outside test suite." );
207+ runningOutsideAlready = true ;
208+ return ;
209+ } catch (IOException ignore ) {
210+ // expected when the server isn't running already
211+ }
202212 try {
203213 tempDirectory = Files .createTempDirectory (containerName );
204214 outPath = tempDirectory .resolve ("stdout" );
@@ -308,6 +318,10 @@ public boolean shouldRetry(
308318
309319 @ Override
310320 public void stop () {
321+ if (runningOutsideAlready ) {
322+ // if the server was running outside the tests already simply return
323+ return ;
324+ }
311325 try {
312326 process .destroy ();
313327 process .waitFor (2 , TimeUnit .SECONDS );
Original file line number Diff line number Diff line change 8787 <logger name =" com.google.cloud.storage" level =" info" />
8888 <logger name =" com.google.cloud.storage.it" level =" warn" />
8989 <logger name =" com.google.cloud.storage.it.runner.registry.Zone" level =" info" />
90+ <logger name =" com.google.cloud.storage.it.runner.registry.TestBench" level =" info" />
9091
9192 <root level =" info" >
9293 <appender-ref ref =" STDOUT" />
You can’t perform that action at this time.
0 commit comments