Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
snowdrop-bot opened this issue Oct 29, 2021 · 0 comments
Assignees
Labels
7 - Community development upstream/closed The issue has been closed in the upstream repository

Comments

@snowdrop-bot
Copy link
Collaborator

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)));
    }

quarkusio#21087


$upstream:21087$

@snowdrop-bot snowdrop-bot added the upstream/closed The issue has been closed in the upstream repository label Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7 - Community development upstream/closed The issue has been closed in the upstream repository
Projects
None yet
Development

No branches or pull requests

2 participants