mirror of
https://github.com/corda/corda.git
synced 2025-06-18 07:08:15 +00:00
Run H2 fix test in parallel (#2504)
* Parallel execution for reduced test time
This commit is contained in:
committed by
GitHub
parent
fa34a16f27
commit
ae63de34ad
@ -42,12 +42,22 @@ class AbstractNodeTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `H2 fix is applied`() {
|
fun `H2 fix is applied`() {
|
||||||
repeat(if (relaxedThoroughness) 1 else 100) {
|
val pool = Executors.newFixedThreadPool(5)
|
||||||
// Two "nodes" seems to be the magic number to reproduce the problem:
|
val runs = if (relaxedThoroughness) 1 else 100
|
||||||
val urls = (0 until 2).map { freshURL() }
|
(0 until runs).map {
|
||||||
|
// Four "nodes" seems to be the magic number to reproduce the problem on CI:
|
||||||
|
val urls = (0 until 4).map { freshURL() }
|
||||||
// Haven't been able to reproduce in a warm JVM:
|
// Haven't been able to reproduce in a warm JVM:
|
||||||
|
pool.fork {
|
||||||
assertEquals(0, startJavaProcess<ColdJVM>(urls).waitFor())
|
assertEquals(0, startJavaProcess<ColdJVM>(urls).waitFor())
|
||||||
}
|
}
|
||||||
|
}.transpose().getOrThrow()
|
||||||
|
pool.shutdown()
|
||||||
|
// The above will always run all processes, even if the very first fails
|
||||||
|
// In theory this can be handled better, but
|
||||||
|
// a) we expect to run all the runs, that's how the test passes
|
||||||
|
// b) it would require relatively complex handling (futures+threads), which is not worth it
|
||||||
|
// because of a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user