Affects: 5.2.13.RELEASE


When running the following test in Kotlin, everything runs fine and succeeds:

class MyTest @Autowired constructor(val testClient: WebTestClient) {
  @Test
  fun myTest() {
    val payloadSize = 1024
    testClient.post()
      .uri("...")
      .bodyValue(ByteBuffer.wrap(Random.nextBytes(payloadSize))
      .exchange()
      .expectStatus().isOk
  }
}

If I change payloadSize to a larger number like 4000000, the same test fails with a 500 Internal Server Error response and no message. If I make a call to that same endpoint directly on a running instance of my service, it handles my request properly. Calling my controller method directly from my test seems to suffice as a stable workaround for now, but this seems like a bug with WebTestClient.

Comment From: sbrannen

If I change payloadSize to a larger number like 4000000, the same test fails with a 500 Internal Server Error response and no message.

Is there a stack trace that is logged as a result of the 500 response?

Comment From: sbrannen

I am not able to reproduce this using Java.

Can you please provide a minimal example that reproduces the issue in Java?

Comment From: AlexVulaj

After some further digging in a stripped down sample project, it seems the issue was that the max-in-memory-size I'd configured for my codec properties was only being applied when running my application, and not within tests. I've added the configuration to both contexts and the issue seems to have resolved itself now. Thanks for taking time to look into this for me.

Comment From: sbrannen

Glad you sorted it out.

Thanks for letting us know.