mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-14 06:45:21 +00:00
For Multi-jdk build failure - tweak DbMigrationTest, add another hack 1 milli sleep
This commit is contained in:
1 parent
ddbd816f6d
commit
52aa1a2d91
1 file changed
+11
-7
@@ -196,7 +196,7 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
hist.setId(2);
|
||||
hist.setTestString(42L);
|
||||
tmpServer.save(hist);
|
||||
|
||||
sleepOneMilli();
|
||||
hist = tmpServer.find(EHistory.class).where().eq("testString", 42L).findOne();
|
||||
hist.setTestString(45L);
|
||||
tmpServer.save(hist);
|
||||
@@ -213,12 +213,7 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
hist2.setTestString2("bar1");
|
||||
hist2.setTestString3("baz1");
|
||||
tmpServer.save(hist2);
|
||||
try {
|
||||
// bit of a hack for H2HistoryTrigger with JDK 11+ JVMs, probably need more than millis precision for H2 history
|
||||
Thread.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
sleepOneMilli();
|
||||
hist2.setTestString("foo2");
|
||||
hist2.setTestString2("bar2");
|
||||
tmpServer.save(hist2);
|
||||
@@ -253,6 +248,15 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
private void sleepOneMilli() {
|
||||
try {
|
||||
// bit of a hack for H2HistoryTrigger with JDK 11+ JVMs, probably need more than millis precision for H2 history
|
||||
Thread.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void createHistoryEntities() {
|
||||
SqlUpdate update = server().sqlUpdate("insert into migtest_e_history (id, test_string) values (1, '42')");
|
||||
assertThat(server().execute(update)).isEqualTo(1);
|
||||
|
||||
Reference in new issue
Block a user