Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ public void testFullBackupConcurrency() throws IOException, InterruptedException
}

final Thread[] threads = new Thread[CONCURRENT_THREADS];

final Database importedDatabase = importDatabase();
try {
final Database importedDatabase = importDatabase();

final VertexType type = importedDatabase.getSchema().createVertexType("BackupTest", CONCURRENT_THREADS);

Expand All @@ -126,12 +127,17 @@ public int getBucketIdByRecord(Document record, boolean async) {
public void run() {
final AtomicInteger totalPerThread = new AtomicInteger();
for (int j = 0; j < 500; j++) {
importedDatabase.transaction(() -> {
for (int k = 0; k < 500; k++) {
MutableVertex v = importedDatabase.newVertex("BackupTest").set("thread", threadId).set("id", totalPerThread.getAndIncrement()).save();
Assertions.assertEquals(threadBucket.getId(), v.getIdentity().getBucketId());
importedDatabase.begin();
for (int k = 0; k < 500; k++) {
MutableVertex v = importedDatabase.newVertex("BackupTest").set("thread", threadId).set("id", totalPerThread.getAndIncrement()).save();
Assertions.assertEquals(threadBucket.getId(), v.getIdentity().getBucketId());

if (k + 1 % 100 == 0) {
importedDatabase.commit();
importedDatabase.begin();
}
});
}
importedDatabase.commit();
}

}
Expand Down Expand Up @@ -170,8 +176,11 @@ public void run() {
}
}

Assertions.assertTrue(DatabaseFactory.getActiveDatabaseInstances().isEmpty(), "Found active databases: " + DatabaseFactory.getActiveDatabaseInstances());
} finally {
importedDatabase.close();

Assertions.assertTrue(DatabaseFactory.getActiveDatabaseInstances().isEmpty(), "Found active databases: " + DatabaseFactory.getActiveDatabaseInstances());

for (int i = 0; i < CONCURRENT_THREADS; i++) {
new File(FILE + "_" + i).delete();
FileUtils.deleteRecursively(new File(DATABASE_PATH + "_restored_" + i));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public void testImportOK() throws IOException {
Assertions.assertEquals("admin", security.getString("name"));
}
}
Assertions.assertTrue(DatabaseFactory.getActiveDatabaseInstances().isEmpty(), "Found active databases: " + DatabaseFactory.getActiveDatabaseInstances());
} finally {
Assertions.assertTrue(DatabaseFactory.getActiveDatabaseInstances().isEmpty(), "Found active databases: " + DatabaseFactory.getActiveDatabaseInstances());
FileUtils.deleteRecursively(databaseDirectory);
}
}
Expand Down
14 changes: 0 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,7 @@
<configuration>
<excludes>
<exclude>**/*HASplitBrainIT.java</exclude>
<exclude>**/*ReplicationServerLeaderDownNoTransactionsToForwardIT.java</exclude>
<exclude>**/*ReplicationServerLeaderChanges3TimesIT.java</exclude>
<exclude>**/*ReplicationServerLeaderDownIT.java</exclude>
<exclude>**/*ReplicationServerQuorumMajority2ServersOutIT.java</exclude>
<exclude>**/*ReplicationServerQuorumAllIT.java</exclude>
<exclude>**/*ReplicationServerQuorumMajorityIT.java</exclude>
<exclude>**/*ReplicationServerQuorumNoneIT.java</exclude>
<exclude>**/*ReplicationServerReplicaHotResyncIT.java</exclude>
<exclude>**/*ReplicationServerReplicaRestartForceDbInstallIT.java</exclude>
<exclude>**/*ReplicationServerWriteAgainstReplicaIT.java</exclude>
<exclude>**/*ServerBackupDatabaseIT.java</exclude>
<exclude>**/*HTTP2ServersIT.java</exclude>
<exclude>**/*TwoServersIT.java</exclude>
<exclude>**/*FullBackupIT.java</exclude>
<exclude>**/*RemoteConsoleIT.java</exclude>
<exclude>**/ArcadeGraphProcessDebugTest.java</exclude>
<exclude>**/ArcadeGraphStructureDebugTest.java</exclude>
<exclude>${exclude.tests}</exclude>
Expand Down