use of org.neo4j.kernel.impl.index.schema.tracking.TrackingIndexExtensionFactory in project neo4j by neo4j.
the class UniqueIndexSeekIT method uniqueIndexSeekDoNotLeakIndexReaders.
@ParameterizedTest
@MethodSource("indexProviderFactories")
void uniqueIndexSeekDoNotLeakIndexReaders(AbstractIndexProviderFactory providerFactory) throws KernelException {
TrackingIndexExtensionFactory indexExtensionFactory = new TrackingIndexExtensionFactory(providerFactory);
GraphDatabaseAPI database = createDatabase(indexExtensionFactory, providerFactory.descriptor());
DependencyResolver dependencyResolver = database.getDependencyResolver();
Config config = dependencyResolver.resolveDependency(Config.class);
try {
Label label = label("spaceship");
String nameProperty = "name";
createUniqueConstraint(database, label, nameProperty);
generateRandomData(database, label, nameProperty);
assertNotNull(indexExtensionFactory.getIndexProvider(config.get(default_database)));
assertThat(numberOfClosedReaders()).isGreaterThan(0L);
assertThat(numberOfOpenReaders()).isGreaterThan(0L);
assertThat(numberOfClosedReaders()).isCloseTo(numberOfOpenReaders(), within(1L));
lockNodeUsingUniqueIndexSeek(database, nameProperty);
assertThat(numberOfClosedReaders()).isCloseTo(numberOfOpenReaders(), within(1L));
} finally {
managementService.shutdown();
}
}
Aggregations