You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If testEnvironment.inject(target) throws an exception we leave the scope open and all future tests fail with the exception:
java.lang.IllegalStateException: TestScope is already in progress.
at com.google.common.base.Preconditions.checkState(Preconditions.java:177)
at com.google.acai.TestScope.enter(TestScope.java:37)
at com.google.acai.Acai$TestEnvironment.beforeTest(Acai.java:160)
at com.google.acai.Acai$1.evaluate(Acai.java:78)
This also means, of course, that we fail to do any per-test tear-down as well in this case.
In fixing this issue another case to be aware of is that if a user defined @BeforeTest method fails currently this would also cause the TestScope to not be exited so simply moving testEnvironment.inject(target) into the try block will not make the code completely robust. We probably need to decouple the enter/exit scope from running @BeforeTest and @AfterTest methods.
The text was updated successfully, but these errors were encountered:
We enter and exit test scope in
TestEnvironment#beforeTest
andTestEnvironment#afterTest
respectively. The code inAcai
which calls these methods looks like:If
testEnvironment.inject(target)
throws an exception we leave the scope open and all future tests fail with the exception:This also means, of course, that we fail to do any per-test tear-down as well in this case.
In fixing this issue another case to be aware of is that if a user defined
@BeforeTest
method fails currently this would also cause the TestScope to not be exited so simply movingtestEnvironment.inject(target)
into the try block will not make the code completely robust. We probably need to decouple the enter/exit scope from running@BeforeTest
and@AfterTest
methods.The text was updated successfully, but these errors were encountered: