I just realised that this code passed all the tests, but only because it wasn't actually invoked:
Panache.getSession().map(session -> session.withTransaction(tx -> {
// run test
}).await().indefinitely();
Can you spot it?
I'm not sure how frequent it is to mess something up with Mutiny, this way or other ways, but perhaps we could make it easier for users to notice these traps somehow?
Perhaps in Quarkus test mode we could inspect the returned value from map operations and if it's a Uni print a warning? This doesn't seem very useful because people tend to ignore warnings.
Another option would be to declare a map operation explicitely for returning a Uni, and deprecate it with a warning that this is probably not what the user wanted to do? I'm not even sure erasure rules would allow this.
I'm not really sold on the idea, and I don't know if there are other common traps, but if there are, we could try to come up with ways to nudge users into the right direction. Perhaps it's not possible, or not worth it. But definitely worth discussing :)
--
Stéphane Épardaud