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

QuarkusMainTest intercepts spurious strings #22302

Closed
andreaTP opened this issue Dec 16, 2021 · 4 comments · Fixed by #22303 or #22455
Closed

QuarkusMainTest intercepts spurious strings #22302

andreaTP opened this issue Dec 16, 2021 · 4 comments · Fixed by #22303 or #22455
Labels
area/testing kind/bug Something isn't working
Milestone

Comments

@andreaTP
Copy link
Contributor

Describe the bug

The QuarkusMainTests are spuriously intercepting output coming from different sources.

Expected behavior

The QuarkusMainTests report back only the output from the specific launched Process.

Actual behavior

No response

How to Reproduce?

I started reducing the error down to a test in this codebase.

In io.quarkus.it.picocli.PicocliTest add the following test:

    @Test
    public void testLogCapturing(QuarkusMainLauncher launcher) {
        org.jboss.logging.Logger.getLogger("test").error("error");
        LaunchResult result = launcher.launch("with-method-sub-command", "hello", "-n", "World!");
        assertThat(result.exitCode()).isZero();
        assertThat(result.getOutput()).isEqualTo("Hello World!");
    }

and the test will fail with an error similar to:

[ERROR] Failures: 
[ERROR]   PicocliTest.testLogCapturing:43 
expected: "Hello World!"
 but was: "2021-12-16 19:28:23,647 ERROR [test] (main) error
Hello World!"
[INFO] 
[ERROR] Tests run: 11, Failures: 1, Errors: 0, Skipped: 0

The expectation is that the test should pass.

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

main

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

No response

Additional information

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Dec 16, 2021

/cc @geoand

@DGuhr
Copy link

DGuhr commented Dec 17, 2021

I've spent quite a few hours on this, thanks for the fix Andrea :)

@andreaTP
Copy link
Contributor Author

You actually found it @DGuhr 👍

@gsmet
Copy link
Member

gsmet commented Dec 17, 2021

Fixed by #22303.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Something isn't working
Projects
None yet
4 participants