From dd650705d07416fd6b8e324d4724d67fbd064145 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Thu, 5 Aug 2021 17:44:35 +0200 Subject: [PATCH] Add some delay between save an update of update-timestamp tests --- .../InVmGenerationsWithAnnotationsWithSqlDateTests.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/InVmGenerationsWithAnnotationsWithSqlDateTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/InVmGenerationsWithAnnotationsWithSqlDateTests.java index f5a40f0996..6032a4e556 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/InVmGenerationsWithAnnotationsWithSqlDateTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/InVmGenerationsWithAnnotationsWithSqlDateTests.java @@ -47,6 +47,13 @@ public class InVmGenerationsWithAnnotationsWithSqlDateTests { assertThat( saved.lastUpdatedOn ).isNotNull(); saved.name = "changed"; + // Let's sleep a millisecond to make sure we actually generate a different timestamp + try { + Thread.sleep( 1L ); + } + catch (InterruptedException e) { + // Ignore + } // then changing final AuditedEntity merged = scope.fromTransaction( session, (s) -> {