Skip to content

Commit

Permalink
Unflake RotatableCsvOutputIT
Browse files Browse the repository at this point in the history
  • Loading branch information
ragadeeshu committed Jan 19, 2018
1 parent 5dcd584 commit fdd0323
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -26,6 +26,7 @@


import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files;


import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.Transaction;
Expand Down Expand Up @@ -81,13 +82,15 @@ public void rotateMetricsFile() throws InterruptedException, IOException
( newValue, currentValue ) -> newValue >= currentValue ); ( newValue, currentValue ) -> newValue >= currentValue );
assertEquals( 1, committedTransactions ); assertEquals( 1, committedTransactions );


File metricsFile2 = metricsCsv( outputPath, TransactionMetrics.TX_COMMITTED, 1 ); metricsCsv( outputPath, TransactionMetrics.TX_COMMITTED, 1 );
try ( Transaction transaction = database.beginTx() ) try ( Transaction transaction = database.beginTx() )
{ {
database.createNode(); database.createNode();
transaction.success(); transaction.success();
} }
long oldCommittedTransactions = readLongValueAndAssert( metricsFile2, // Since we rotated twice, file 3 is actually the original file
File metricsFile3 = metricsCsv( outputPath, TransactionMetrics.TX_COMMITTED, 2 );
long oldCommittedTransactions = readLongValueAndAssert( metricsFile3,
( newValue, currentValue ) -> newValue >= currentValue ); ( newValue, currentValue ) -> newValue >= currentValue );
assertEquals( 1, oldCommittedTransactions ); assertEquals( 1, oldCommittedTransactions );
} }
Expand Down

0 comments on commit fdd0323

Please sign in to comment.