snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

quarkus.test.wait-time is documented as Duration type but only numbers are supported #443

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

The documentation for all quarkus config options indicates that quarkus.test.wait-time is of Duration type: https://quarkus.io/guides/all-config#quarkus-core_quarkus.test.wait-time. However, passing valid duration strings doesn't work. Only plain numbers representing seconds can be used.

Expected behavior

Passing things like PT20S should work.

Actual behavior

java.lang.NumberFormatException: SRCFG00030: Expected a long value, got "PT2S"

How to Reproduce?

  1. Take some random example project
  2. mvn verify -Pnative -Dquarkus.test.wait-time=PT2S

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.3.1 or latest development version

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

The culprit seems to be the waitTimeValue method in ConfigUtil, which assumes the config value to be a number:

    public static Duration waitTimeValue(Config config) {
        return Duration.ofSeconds(config.getValue("quarkus.test.wait-time", OptionalLong.class)
                .orElse(config.getValue("quarkus.test.jar-wait-time", OptionalLong.class) // legacy value
                        .orElse(DEFAULT_WAIT_TIME_SECONDS)));
    }

https://github.com/quarkusio/quarkus/issues/21087


$upstream:21087$