Skip to content

Commit

Permalink
Fix MetricsKernelExtensionFactoryIT test flakiness and test bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvest committed May 26, 2017
1 parent 9b91b7c commit 3a6371e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Expand Up @@ -19,7 +19,6 @@
*/
package org.neo4j.metrics;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -200,7 +199,7 @@ public void shouldUseEventBasedReportingCorrectly() throws Throwable
// wait for the file to be written before shutting down the cluster
File metricFile = metricsCsv( outputPath, CheckPointingMetrics.CHECK_POINT_DURATION );

long result = readLongValueAndAssert( metricFile, ( newValue, currentValue ) -> newValue > 0 );
long result = readLongValueAndAssert( metricFile, ( newValue, currentValue ) -> newValue >= 0 );

// THEN
assertThat( result, greaterThanOrEqualTo( 0L ) );
Expand Down
Expand Up @@ -53,7 +53,13 @@ public static long readLongValueAndAssert( File metricFile, BiPredicate<Integer,

try ( BufferedReader reader = new BufferedReader( new FileReader( metricFile ) ) )
{
String[] headers = reader.readLine().split( "," );
String s;
do
{
s = reader.readLine();
}
while ( s == null );
String[] headers = s.split( "," );
assertThat( headers.length, is( 2 ) );
assertThat( headers[TIME_STAMP], is( "t" ) );
assertThat( headers[METRICS_VALUE], is( "value" ) );
Expand Down

0 comments on commit 3a6371e

Please sign in to comment.