diff --git a/app/src/main/java/io/seqera/wave/cli/App.java b/app/src/main/java/io/seqera/wave/cli/App.java index 1b22a84..7c8e0d6 100644 --- a/app/src/main/java/io/seqera/wave/cli/App.java +++ b/app/src/main/java/io/seqera/wave/cli/App.java @@ -313,6 +313,10 @@ else if( isEmpty(waveEndpoint) ) { waveEndpoint = Client.DEFAULT_ENDPOINT; } + if ( Duration.ofMinutes(15).equals(await) && !isEmpty(towerToken) ) { + await = Duration.ofMinutes(25); + } + } protected void validateArgs() { diff --git a/app/src/test/groovy/io/seqera/wave/cli/AppTest.groovy b/app/src/test/groovy/io/seqera/wave/cli/AppTest.groovy index 45e9e86..30f3e93 100644 --- a/app/src/test/groovy/io/seqera/wave/cli/AppTest.groovy +++ b/app/src/test/groovy/io/seqera/wave/cli/AppTest.groovy @@ -500,6 +500,24 @@ class AppTest extends Specification { and: app.@await == Duration.ofMinutes(15) } + + def 'should get the default await duration when --tower-token is provided'(){ + given: + def app = new App() + String[] args = ["-i", "ubuntu:latest", '--await', '--tower-token', 'token'] + + when: + def cli = new CommandLine(app) + cli.registerConverter(Duration.class, new DurationConverter()) + cli.parseArgs(args) + and: + app.validateArgs() + app.defaultArgs() + then: + noExceptionThrown() + and: + app.@await == Duration.ofMinutes(25) + } def 'should get the correct name strategy'(){ given: