eclipse-vertx / vertx-junit5

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

timeout doesn't work for nested class' test methods #121

Closed matter-it-does closed 1 year ago

matter-it-does commented 1 year ago

Version

Which version(s) did you encounter this bug ?

4.2.5

Context

I have timeout set to 1000s, but while debugging with breakpoints a nested class test method, test fails.

DavideD commented 1 year ago

In addition to this, It would be nice to also check if org.junit.jupiter.api.TimeOut is present and use it as default. I think this was the behaviour with JUnit 4.

DavideD commented 1 year ago

It would also be nice to have this as an extension. This way it could be reused when creating new extension

tsegismont commented 1 year ago

This way it could be reused when creating new extension

Not sure what you mean, can you explain?

DavideD commented 1 year ago

Currently, in Hibernate Reactive I did this to configure the timeout in the tests: https://github.com/hibernate/hibernate-reactive/pull/1635/commits/2aa49478846ce098dbf6c9d7a063210cf805deae

Each class is annotated with TimeOut and extends the BaseReactiveTest class.

Instead, I would like to have an extensionHibernateReactiveTestExtension that does all the configuration without having to inherit from a super class. This means:

That said, I haven't given too much thought and maybe this doesn't work in practice, but my initial impression is that extensions provide more flexibility over annotations.

tsegismont commented 1 year ago

@DavideD is it possible for you to try the patch in #133?

tsegismont commented 1 year ago

@DavideD actually, checking out the branch from #134 and building would be better as #133 targets Vert.x 5

DavideD commented 1 year ago

I will try to test it before the end of the day

tsegismont commented 1 year ago

Fixed in #134

DavideD commented 1 year ago

@tsegismont I've tested this quickly and it doesn't seem to work. I don't have time to debug this now, but if you want to try, you can test this with Hibernate Reactive on this branch: https://github.com/DavideD/hibernate-reactive/tree/timeout

The test is ReactiveSessionTest

The first couple of tests should fail because it takes too long to download and start Sql Server with docker