showStandardStreams is false, stdout is printing anyway

I’ve got some Junit tests set up, and my code (not just my tests) use Logback for output. Essentially what I want is to make it so that only failing tests have their stdout/stderr printed to the console. However, I have this bit in my build.gradle:

test {
  testLogging {
    events "failed"
    showStandardStreams = false
  }
}

I was hoping that using this combined with onOutput would give me the functionality I need, but for every single test I’m still getting output like this:

org.forwarder.BatchForwarderTests > forwarderTimersWithSampling STANDARD_OUT
    11:48:35.991 [Test worker] DEBUG o.h.f.forwarder.BatchForwarder - prefix:htv.qa
    timer:3,5@0.1
    anotherTimer:5,12@0.5

What’s going on? How can I actually suppress stdout?

Which exact Gradle command are you running? Are you running with debug logging?

./gradlew test

So I assume no debug logging.

I added a task that prints test.testLogging.events, and got back [FAILED, STANDARD_OUT, STANDARD_ERROR]. I can fix it by setting test.testLogging.events explicitly back to only failed inside a task, but I still have no idea how or why my settings either aren’t taking effect or are being overridden.

Try without ‘showStandardStreams = false’; it’s (at best) redundant.

No dice, still prints.

I am also having this problem.