Skip to content

Commit

Permalink
Merge pull request #11681 from MishaDemianenko/3.4-node-id-reuse-inve…
Browse files Browse the repository at this point in the history
…stigation

Print additional info when id controller not found in NodeIdReuseStressIT
  • Loading branch information
MishaDemianenko committed May 15, 2018
2 parents c0f25a8 + fb24827 commit ade8a56
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
package org.neo4j.kernel.impl.enterprise.store.id;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -55,7 +56,7 @@ public class NodeIdReuseStressIT
private static final int OPERATIONS_COUNT = 10_000;

@Rule
public DatabaseRule db = new EnterpriseDatabaseRule()
public final DatabaseRule db = new EnterpriseDatabaseRule()
.withSetting( EnterpriseEditionSettings.idTypesToReuse, IdType.NODE.name() );

@Before
Expand Down Expand Up @@ -123,7 +124,17 @@ private static void maybeRunIdMaintenance( GraphDatabaseService db, int iteratio
if ( iteration % 100 == 0 && ThreadLocalRandom.current().nextBoolean() )
{
DependencyResolver resolver = dependencyResolver( db );
resolver.resolveDependency( IdController.class ).maintenance();
IdController idController = resolver.resolveDependency( IdController.class );
if ( idController != null )
{
idController.maintenance();
}
else
{
System.out.println( "Id controller is null. Dumping resolver content." );
System.out.println( "Resolver: " + ReflectionToStringBuilder.toString( resolver ) );
throw new IllegalStateException( "Id controller not found" );
}
}
}

Expand Down

0 comments on commit ade8a56

Please sign in to comment.