This is an automated email from the ASF dual-hosted git repository. ntimofeev pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cayenne.git
The following commit(s) were added to refs/heads/master by this push: new dc87bd62b Improve test stability dc87bd62b is described below commit dc87bd62bdfbec0cf9a0a4ef14f429078d9d28c2 Author: Nikita Timofeev <stari...@gmail.com> AuthorDate: Fri Jan 31 17:36:55 2025 +0400 Improve test stability --- .../test/java/org/apache/cayenne/access/CAY2723IT.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/cayenne/src/test/java/org/apache/cayenne/access/CAY2723IT.java b/cayenne/src/test/java/org/apache/cayenne/access/CAY2723IT.java index a883ed7fe..c6761d49f 100644 --- a/cayenne/src/test/java/org/apache/cayenne/access/CAY2723IT.java +++ b/cayenne/src/test/java/org/apache/cayenne/access/CAY2723IT.java @@ -18,6 +18,7 @@ ****************************************************************/ package org.apache.cayenne.access; +import org.apache.cayenne.dba.JdbcPkGenerator; import org.apache.cayenne.di.Inject; import org.apache.cayenne.testdo.testmap.Painting; import org.apache.cayenne.testdo.testmap.PaintingInfo; @@ -25,14 +26,11 @@ import org.apache.cayenne.unit.di.DataChannelInterceptor; import org.apache.cayenne.unit.di.runtime.CayenneProjects; import org.apache.cayenne.unit.di.runtime.RuntimeCase; import org.apache.cayenne.unit.di.runtime.UseCayenneRuntime; -import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.assertEquals; @UseCayenneRuntime(CayenneProjects.TESTMAP_PROJECT) -@Ignore("This test fails on GitHub Actions, disabling for now") public class CAY2723IT extends RuntimeCase { @Inject private DataContext context; @@ -40,13 +38,10 @@ public class CAY2723IT extends RuntimeCase { @Inject private DataChannelInterceptor queryInterceptor; - /** - * need to run this to ensure that PK generation doesn't affect main test - */ - @Before - public void warmup() { + @Test + public void phantomToDepPKUpdate() { // try to trigger PK generator. so it wouldn't random fail the actual test - for (int i = 0; i < 20; i++) { + for (int i = 0; i < JdbcPkGenerator.DEFAULT_PK_CACHE_SIZE; i++) { int queryCounter = queryInterceptor.runWithQueryCounter(() -> { Painting painting = context.newObject(Painting.class); painting.setPaintingTitle("test_warmup"); @@ -54,13 +49,10 @@ public class CAY2723IT extends RuntimeCase { }); // PK generator triggered, we are ready if (queryCounter > 1) { - return; + break; } } - } - @Test - public void phantomToDepPKUpdate() { Painting painting = context.newObject(Painting.class); painting.setPaintingTitle("test_p_123");