Skip to content

Commit

Permalink
Update eventual condition in ServerMetricsIT.
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaDemianenko committed Sep 11, 2018
1 parent 9bc8fe5 commit 7f93c78
Showing 1 changed file with 16 additions and 4 deletions.
Expand Up @@ -29,6 +29,7 @@


import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;


import org.neo4j.metrics.MetricsSettings; import org.neo4j.metrics.MetricsSettings;
Expand Down Expand Up @@ -91,10 +92,21 @@ public void shouldShowServerMetrics() throws Throwable
} }
} }


private static void assertMetricsExists( File metricsPath, String meticsName ) throws IOException, InterruptedException private static void assertMetricsExists( File metricsPath, String metricsName ) throws InterruptedException
{ {
File file = metricsCsv( metricsPath, meticsName ); File file = metricsCsv( metricsPath, metricsName );
long threadCount = readLongValue( file ); assertEventually( () -> threadCountReader( file ), greaterThan( 0L ), 1, TimeUnit.MINUTES );
assertEventually( () -> threadCount, greaterThan( 0L ), 1, TimeUnit.MINUTES ); }

private static Long threadCountReader( File file ) throws InterruptedException
{
try
{
return readLongValue( file );
}
catch ( IOException io )
{
throw new UncheckedIOException( io );
}
} }
} }

0 comments on commit 7f93c78

Please sign in to comment.