| 1 |
package morfologik.fsa.builders; |
| 2 |
|
| 3 |
import org.junit.runner.RunWith; |
| 4 |
|
| 5 |
import com.carrotsearch.randomizedtesting.MixWithSuiteName; |
| 6 |
import com.carrotsearch.randomizedtesting.RandomizedRunner; |
| 7 |
import com.carrotsearch.randomizedtesting.ThreadFilter; |
| 8 |
import com.carrotsearch.randomizedtesting.annotations.SeedDecorators; |
| 9 |
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakAction; |
| 10 |
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakAction.Action; |
| 11 |
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters; |
| 12 |
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakGroup; |
| 13 |
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakGroup.Group; |
| 14 |
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakLingering; |
| 15 |
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope; |
| 16 |
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope.Scope; |
| 17 |
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakZombies; |
| 18 |
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakZombies.Consequence; |
| 19 |
import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; |
| 20 |
|
| 21 |
@RunWith(RandomizedRunner.class) |
| 22 |
@SeedDecorators({MixWithSuiteName.class}) |
| 23 |
@ThreadLeakScope(Scope.SUITE) |
| 24 |
@ThreadLeakGroup(Group.MAIN) |
| 25 |
@ThreadLeakAction({Action.WARN, Action.INTERRUPT}) |
| 26 |
@ThreadLeakLingering(linger = /* millis */ 5 * 1000) |
| 27 |
@ThreadLeakZombies(Consequence.IGNORE_REMAINING_TESTS) |
| 28 |
@TimeoutSuite(millis = /* millis */ 360 * 1000) |
| 29 |
@ThreadLeakFilters(defaultFilters = true, filters = {TestBase.CustomThreadFilter.class}) |
| 30 |
public abstract class TestBase { |
| 31 |
/** |
| 32 |
* Any custom thread filters we should ignore. |
| 33 |
*/ |
| 34 |
public static class CustomThreadFilter implements ThreadFilter { |
| 35 |
@Override |
| 36 |
public boolean reject(Thread t) { |
| 37 |
// IBM J9 bogus threads. |
| 38 |
String threadName = t.getName(); |
| 39 |
if ("Attach API wait loop".equals(threadName) || |
| 40 |
"file lock watchdog".equals(threadName) || |
| 41 |
"ClassCache Reaper".equals(threadName)) { |
| 42 |
return true; |
| 43 |
} |
| 44 |
|
| 45 |
return false; |
| 46 |
} |
| 47 |
} |
| 48 |
} |