junit4
junit4 copied to clipboard
Add timeout attribute to @BeforeClass, @Before, @After, and @AfterClass
Please add a timeout attribute to @BeforeClass, @Before, @After, and @AfterClass.
This will allow set ups and tear downs to databases and other expensive remote resources to gracefully stop and kill tests that cannot be set up properly.
Have you tried using a custom Rule to do this?
Nope. Saying @BeforeClass(timeout=10000) like we do now @Test(timeout=10000) would sure look better and consistent.
Given your use case, you probably would want to have reusable objects anyway (ex: a database test fixture). I'm just trying to suggest workarounds.
Anyway, I am personally not opposed to timeout attributes. Feel free so send us a pull request, but we are really close to releasing 4.12, so it may have to wait until 4.13
Hi, is someone working on this?
@jaruk no one to my knowledge is working on this. Would you like to take a stab at it?
yes
Which JUnit release contains this change ?
Thanks
@tedyu no one has sent a pull request for this proposed change
@jaruk how close is your issue958 branch to being ready for review?