You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2022/02/21 20:34:25 UTC

[jspwiki] branch master updated: Trying to remove test flakiness - remove awaitily call, only use pages created on test

This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git


The following commit(s) were added to refs/heads/master by this push:
     new e26eede  Trying to remove test flakiness - remove awaitily call, only use pages created on test
e26eede is described below

commit e26eede4f22585c4b93112022d85a9cb19407f1e
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Mon Feb 21 21:32:07 2022 +0100

    Trying to remove test flakiness - remove awaitily call, only use pages created on test
---
 .../org/apache/wiki/references/ReferenceManagerTest.java     | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/jspwiki-main/src/test/java/org/apache/wiki/references/ReferenceManagerTest.java b/jspwiki-main/src/test/java/org/apache/wiki/references/ReferenceManagerTest.java
index 8372f3b..e04ef22 100644
--- a/jspwiki-main/src/test/java/org/apache/wiki/references/ReferenceManagerTest.java
+++ b/jspwiki-main/src/test/java/org/apache/wiki/references/ReferenceManagerTest.java
@@ -17,7 +17,6 @@ import org.apache.wiki.TestEngine;
 import org.apache.wiki.api.exceptions.WikiException;
 import org.apache.wiki.api.spi.Wiki;
 import org.apache.wiki.pages.PageManager;
-import org.awaitility.Awaitility;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
@@ -191,12 +190,13 @@ public class ReferenceManagerTest  {
 
     @Test
     public void testUpdateBothExist() throws Exception {
-        engine.saveText( "Foobars", "qwertz" );
-        Awaitility.await().until( () -> mgr.findReferrers( "Foobars" ).size() == 2 ); // might take a little on CI, let's wait
-        final Collection< String > c = mgr.findReferrers( "Foobars" );
+        engine.saveText( "BooFars", "qwertz" );
+        engine.saveText( "Boo0", "Reference to [BooFars]" );
+        engine.saveText( "Boo1", "Another reference to [BooFars]" );
+        final Collection< String > c = mgr.findReferrers( "BooFars" );
         Assertions.assertNotNull( c, "referrers expected" );
-        Assertions.assertEquals( 2, c.size(), "Foobars referrers: " + c );
-        Assertions.assertTrue( c.contains( "TestPage" ) && c.contains("Foobar"), "Foobars referrer is not TestPage" );
+        Assertions.assertEquals( 2, c.size(), "BooFars referrers: " + c );
+        Assertions.assertTrue( c.contains( "Boo0" ) && c.contains("Boo1"), "BooFars referrers are not Boo*" );
     }
 
     @Test