eclipse-vertx / vertx-junit5

Testing Vert.x applications with JUnit 5
Apache License 2.0
42 stars 30 forks source link

Better diagnostics for Checkpoint.flag #67

Closed tombentley closed 4 years ago

tombentley commented 4 years ago

If I write a test which uses multiple checkpoints then if one of them doesn't have flag() called I get "java.util.concurrent.TimeoutException: The test execution timed out. Make sure your asynchronous code includes calls to either VertxTestContext#completeNow(), VertxTestContext#failNow() or Checkpoint#flag()". In y particular case I know I have all the necessary flag()s in the code, and I know that one of them is not getting called, but I've no idea which one, which makes it harder to debug.

It would be much more helpful if it told me which checkpoint hadn't been flagged. For example this could be either in the form of a stacktrace from the point at which checkpoint() was called, or or by having the option to name checkpoints.

jponge commented 4 years ago

Naming checkpoints is probably a better option, because otherwise we'd need to capture a stack trace when a checkpoint is being created, but I'm not sure it's very efficient / clean.

jponge commented 4 years ago

@tombentley #72 provides a potential solution for that, feedback is welcome!

tombentley commented 4 years ago

Thanks!