Print stack trace in FreezeAndRecordInsertAtomicityTest if error happend
@@ -94,23 +94,21 @@ public class FreezeAndRecordInsertAtomicityTest {
for (int i = 0; i < THREADS; ++i) {
final int thread = i;
- futures.add(executorService.submit(new Runnable() {
- @Override
- public void run() {
+ futures.add(executorService.submit(() -> {
try {
final ODatabaseDocumentTx db = new ODatabaseDocumentTx(URL);
db.open("admin", "admin");
final OIndex<?> index = db.getMetadata().getIndexManager().getIndex("Person.name");
- for (int i = 0; i < ITERATIONS; ++i)
+ for (int i1 = 0; i1 < ITERATIONS; ++i1)
switch (random.nextInt(3)) {
case 0:
- db.newInstance("Person").field("name", "name-" + thread + "-" + i).save();
+ db.newInstance("Person").field("name", "name-" + thread + "-" + i1).save();
break;
case 1:
db.begin();
- db.newInstance("Person").field("name", "name-" + thread + "-" + i).save();
+ db.newInstance("Person").field("name", "name-" + thread + "-" + i1).save();
db.commit();
break;
@@ -125,10 +123,12 @@ public class FreezeAndRecordInsertAtomicityTest {
break;
}
+ } catch (RuntimeException | Error e) {
+ e.printStackTrace();
+ throw e;
} finally {
countDownLatch.countDown();
}
- }
}));
}
