Skip to content

Commit

Permalink
Merge pull request #9931 from klaren/3.3-cc-idreuse-transient
Browse files Browse the repository at this point in the history
Add transient exception to IdReusabilityStressTesting
  • Loading branch information
MishaDemianenko committed Aug 31, 2017
2 parents 34bdfb5 + ad7d6af commit dd4994a
Showing 1 changed file with 13 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
*/
package org.neo4j.causalclustering.stresstests;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import java.io.File;
import java.security.SecureRandom;
import java.util.List;
Expand All @@ -33,10 +37,6 @@
import java.util.function.BooleanSupplier;
import java.util.stream.Collectors;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import org.neo4j.causalclustering.discovery.Cluster;
import org.neo4j.causalclustering.discovery.CoreClusterMember;
import org.neo4j.concurrent.Futures;
Expand All @@ -47,6 +47,7 @@
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.TransactionFailureException;
import org.neo4j.graphdb.TransientTransactionFailureException;
import org.neo4j.graphdb.security.WriteOperationsNotAllowedException;
import org.neo4j.helper.RepeatUntilCallable;
import org.neo4j.helpers.collection.Iterables;
Expand Down Expand Up @@ -136,11 +137,6 @@ public void shouldBehaveCorrectlyUnderStress() throws Exception

Futures.combine( insertLoad, deleteLoad1, deleteLoad2, reelectionLoad ).get( durationInMinutes + 5, MINUTES );
}
catch ( Throwable e )
{
System.out.println( "Exception thrown from execution service:" );
e.printStackTrace( System.out );
}
finally
{
service.shutdown();
Expand Down Expand Up @@ -215,8 +211,11 @@ private static boolean isTransient( Throwable e )
return false;
}

if ( e instanceof TimeoutException || e instanceof DatabaseShutdownException ||
e instanceof TransactionFailureException || e instanceof AcquireLockTimeoutException )
if ( e instanceof TimeoutException ||
e instanceof DatabaseShutdownException ||
e instanceof TransactionFailureException ||
e instanceof AcquireLockTimeoutException ||
e instanceof TransientTransactionFailureException )
{
return true;
}
Expand Down Expand Up @@ -271,9 +270,7 @@ protected void doWork()
return;
}

// Ignore throws for now
System.out.println( "InsertionWorkload encountered error:" );
e.printStackTrace( System.out );
throw new RuntimeException( "InsertionWorkload", e );
}
}
}
Expand Down Expand Up @@ -309,9 +306,7 @@ protected void doWork()
return;
}

// Ignore throws for now
System.out.println( "ReelectionWorkload encountered error:" );
e.printStackTrace( System.out );
throw new RuntimeException( "ReelectionWorkload", e );
}
}
}
Expand Down Expand Up @@ -355,9 +350,7 @@ protected void doWork()
return;
}

// Ignore throws for now
System.out.println( "DeletionWorkload encountered error:" );
e.printStackTrace( System.out );
throw new RuntimeException( "DeletionWorkload", e );
}
}
}
Expand Down

0 comments on commit dd4994a

Please sign in to comment.