-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test only - Adjust timing in TestHistoryInsert.mariadb_simple_history()
- Loading branch information
Showing
1 changed file
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ public class TestHistoryInsert extends BaseTestCase { | |
public void mariadb_simple_history() { | ||
|
||
Timestamp t0 = new Timestamp(System.currentTimeMillis()); | ||
littleSleep(); | ||
littleSleep(50); | ||
|
||
User user = new User(); | ||
user.setName("Jim"); | ||
|
@@ -37,15 +37,16 @@ public void mariadb_simple_history() { | |
DB.save(user); | ||
Timestamp t1 = new Timestamp(System.currentTimeMillis()); | ||
|
||
littleSleep(); | ||
littleSleep(100); | ||
user.setName("NotJim"); | ||
user.save(); | ||
Timestamp t2 = new Timestamp(System.currentTimeMillis()); | ||
|
||
littleSleep(); | ||
littleSleep(100); | ||
user.setName("NotJimV2"); | ||
user.setEmail("[email protected]"); | ||
user.save(); | ||
littleSleep(50); | ||
Timestamp t3 = new Timestamp(System.currentTimeMillis()); | ||
|
||
List<Version<User>> versions = DB.find(User.class).setId(user.getId()).findVersionsBetween(t0, t3); | ||
|
@@ -66,9 +67,9 @@ public void mariadb_simple_history() { | |
assertThat(user0).isNull(); | ||
} | ||
|
||
private void littleSleep() { | ||
private void littleSleep(int millis) { | ||
try { | ||
Thread.sleep(100); | ||
Thread.sleep(millis); | ||
} catch (InterruptedException e) { | ||
throw new RuntimeException(e); | ||
} | ||
|