From d4fdf7c8f487e90c64429d4896cc169cddd7cab3 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lievremont Date: Mon, 1 Sep 2014 14:23:49 +0200 Subject: [PATCH] SONAR-5484 Fix test on windows --- .../org/sonar/server/search/SearchHealthMediumTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/SearchHealthMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/SearchHealthMediumTest.java index 05440c82ef9..43716e75379 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/search/SearchHealthMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/search/SearchHealthMediumTest.java @@ -22,6 +22,7 @@ package org.sonar.server.search; import org.junit.ClassRule; import org.junit.Test; import org.sonar.api.rule.RuleKey; +import org.sonar.api.utils.System2; import org.sonar.core.persistence.DbSession; import org.sonar.server.db.DbClient; import org.sonar.server.rule.RuleTesting; @@ -59,7 +60,10 @@ public class SearchHealthMediumTest { assertThat(nodeHealth.getFsUsedPercent()).contains("%"); assertThat(nodeHealth.getJvmThreads()).isGreaterThanOrEqualTo(0L); assertThat(nodeHealth.getProcessCpuPercent()).contains("%"); - assertThat(nodeHealth.getOpenFiles()).isGreaterThanOrEqualTo(0L); + long openFiles = nodeHealth.getOpenFiles(); + if (!tester.get(System2.class).isOsWindows()) { + assertThat(openFiles).isGreaterThanOrEqualTo(0L); + } assertThat(nodeHealth.getJvmUpSince().before(now)).isTrue(); Map indexHealth = health.getIndexHealth(); -- 2.39.5