ConcurrentIndexTest: don't hang on computers with odd core count

This commit is contained in:
peter
2017-03-30 08:10:22 +02:00
parent 478cae19bf
commit e6e69a4d8a
@@ -57,7 +57,7 @@ class ConcurrentIndexTest extends JavaCodeInsightFixtureTestCase {
def futuresToWait = []
def sameStartCondition = new CountDownLatch(N)
for(i in 1..N/2) {
for(i in 1.. N/2) {
futuresToWait.add(ApplicationManager.application.executeOnPooledThread {
sameStartCondition.countDown()
sameStartCondition.await()
@@ -153,7 +153,8 @@ class ConcurrentIndexTest extends JavaCodeInsightFixtureTestCase {
def futuresToWait = []
def sameStartCondition = new CountDownLatch(N)
for(j in 1..N/2) {
def halfN = N / 2
for(j in 1..halfN) {
futuresToWait.add(ApplicationManager.application.executeOnPooledThread {
ApplicationManager.application.runReadAction {
sameStartCondition.countDown()
@@ -163,7 +164,7 @@ class ConcurrentIndexTest extends JavaCodeInsightFixtureTestCase {
})
}
for(j in 1..N/2) {
for(j in 1..(N - halfN)) {
futuresToWait.add(ApplicationManager.application.executeOnPooledThread {
ApplicationManager.application.runReadAction {
sameStartCondition.countDown()