mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
FIX: TestHistoryInsert / TestNewTypes failing nondeterministic
This commit is contained in:
@@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
public class TestHistoryInsert extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
public void test() throws InterruptedException {
|
||||
|
||||
SpiEbeanServer defaultServer = (SpiEbeanServer)Ebean.getDefaultServer();
|
||||
if (!"h2".equals(defaultServer.getDatabasePlatform().getName())) {
|
||||
@@ -41,6 +41,7 @@ public class TestHistoryInsert extends BaseTestCase {
|
||||
assertThat(versions).hasSize(1);
|
||||
|
||||
user.setName("Jim v2");
|
||||
Thread.sleep(10); // wait, to ensure that whenModified differs
|
||||
Ebean.save(user);
|
||||
|
||||
history = fetchHistory(user);
|
||||
|
||||
@@ -19,8 +19,7 @@ public class TestNewTypes extends BaseTestCase {
|
||||
|
||||
private static final String TEMP_PATH = new File("/tmp").getAbsolutePath();
|
||||
@Test
|
||||
public void testInsertUpdate() throws IOException {
|
||||
|
||||
public void testInsertUpdate() throws IOException, InterruptedException {
|
||||
SomeNewTypesBean bean = new SomeNewTypesBean();
|
||||
bean.setLocalDate(LocalDate.now());
|
||||
bean.setLocalDateTime(LocalDateTime.now());
|
||||
@@ -42,7 +41,7 @@ public class TestNewTypes extends BaseTestCase {
|
||||
bean.setMonth(Month.SEPTEMBER);
|
||||
|
||||
Ebean.save(bean);
|
||||
|
||||
Thread.sleep(10); // wait, to ensure that instant < Instant.now()
|
||||
List<SomeNewTypesBean> list = Ebean.find(SomeNewTypesBean.class).where().lt("instant", Instant.now()).findList();
|
||||
assertTrue(!list.isEmpty());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user