Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-125555

MentionsPortletTest fails if you have more than 20 users in your Liferay installation

    Details

      Description

      This issue is reproduced in the master branch in case you execute MentionsPortletTest in your local Liferay installation and you have more than 20 users.

      I have also reproduce it in the CI tests during the backport to 7.2.x branch of LPS-123084 + LPS-103408

      This problem is produced in following tests, when you execute it in local:

      • MentionsPortletTest#testServletResponseWithoutQuery
      • MentionsPortletTest#testServletResponseWithQueryWithWildard
      • MentionsPortletTest#testServletResponseWithQueryWithWildcardAndNoResults

      The problem of having existing users in the Liferay installation was partially handled in LPS-112145.

      LPS-112145 added some logic that gets the number of users in your company, but in case you have more than 20 users, the mentionsPortlet is only returning 20, because there is a hard limit in the finder code, see:

      So if you have more than 20 users, you will get an java.lang.AssertionError: expected:<xxx> but was:<19> error

      Steps to reproduce

      1. Start a Liferay installation
      2. Add new users until you have more than 20
      3. Go to modules/apps/mentions/mentions-web-test and execute all the integration tests with gradlew testIntegration
        • Expected behavior: All the tests are executed correctly
        • Wrong behavior: There are three tests that fail
          com.liferay.mentions.web.test.MentionsPortletTest STANDARD_OUT
              Loading jar:file:/home/jorge/bundles_builds/portal-master/tomcat-9.0.37/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
          
          com.liferay.mentions.web.test.MentionsPortletTest > testServletResponseWithQueryWithFullScreenName STARTED
          
          com.liferay.mentions.web.test.MentionsPortletTest > testServletResponseWithQueryWithFullScreenName PASSED
          
          com.liferay.mentions.web.test.MentionsPortletTest > testServletResponseWithQueryWithPartialScreenName STARTED
          
          com.liferay.mentions.web.test.MentionsPortletTest > testServletResponseWithQueryWithPartialScreenName PASSED
          
          com.liferay.mentions.web.test.MentionsPortletTest > testServletResponseWithQueryWithWildard STARTED
          
          com.liferay.mentions.web.test.MentionsPortletTest > testServletResponseWithQueryWithWildard FAILED
              java.lang.AssertionError: expected:<101> but was:<19>
                  at org.junit.Assert.fail(Assert.java:89)
                  at org.junit.Assert.failNotEquals(Assert.java:835)
                  at org.junit.Assert.assertEquals(Assert.java:647)
                  at org.junit.Assert.assertEquals(Assert.java:633)
                  at com.liferay.mentions.web.test.MentionsPortletTest.testServletResponseWithQueryWithWildard(MentionsPortletTest.java:204)
                  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$3.evaluate(TestExecutorRunnable.java:353)
                  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at org.junit.rules.RunRules.evaluate(RunRules.java:20)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$1.evaluate(TestExecutorRunnable.java:237)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at org.junit.rules.RunRules.evaluate(RunRules.java:20)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable._execute(TestExecutorRunnable.java:316)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable.run(TestExecutorRunnable.java:95)
                  at java.base/java.lang.Thread.run(Thread.java:834)
          
          com.liferay.mentions.web.test.MentionsPortletTest > testServletResponseWithQueryWithWildcardAndNoResults STARTED
          
          com.liferay.mentions.web.test.MentionsPortletTest > testServletResponseWithQueryWithWildcardAndNoResults FAILED
              java.lang.AssertionError: expected:<100> but was:<19>
                  at org.junit.Assert.fail(Assert.java:89)
                  at org.junit.Assert.failNotEquals(Assert.java:835)
                  at org.junit.Assert.assertEquals(Assert.java:647)
                  at org.junit.Assert.assertEquals(Assert.java:633)
                  at com.liferay.mentions.web.test.MentionsPortletTest.testServletResponseWithQueryWithWildcardAndNoResults(MentionsPortletTest.java:239)
                  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$3.evaluate(TestExecutorRunnable.java:353)
                  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at org.junit.rules.RunRules.evaluate(RunRules.java:20)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$1.evaluate(TestExecutorRunnable.java:237)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at org.junit.rules.RunRules.evaluate(RunRules.java:20)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable._execute(TestExecutorRunnable.java:316)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable.run(TestExecutorRunnable.java:95)
                  at java.base/java.lang.Thread.run(Thread.java:834)
          
          com.liferay.mentions.web.test.MentionsPortletTest > testServletResponseWithoutQuery STARTED
          
          com.liferay.mentions.web.test.MentionsPortletTest > testServletResponseWithoutQuery FAILED
              java.lang.AssertionError: expected:<101> but was:<19>
                  at org.junit.Assert.fail(Assert.java:89)
                  at org.junit.Assert.failNotEquals(Assert.java:835)
                  at org.junit.Assert.assertEquals(Assert.java:647)
                  at org.junit.Assert.assertEquals(Assert.java:633)
                  at com.liferay.mentions.web.test.MentionsPortletTest.testServletResponseWithoutQuery(MentionsPortletTest.java:104)
                  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$3.evaluate(TestExecutorRunnable.java:353)
                  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
                  at org.junit.rules.RunRules.evaluate(RunRules.java:20)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$1.evaluate(TestExecutorRunnable.java:237)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
                  at org.junit.rules.RunRules.evaluate(RunRules.java:20)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable._execute(TestExecutorRunnable.java:316)
                  at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable.run(TestExecutorRunnable.java:95)
                  at java.base/java.lang.Thread.run(Thread.java:834)
          
          5 tests completed, 3 failed
          There were failing tests. See the report at: file:///home/jorge/code/portal-master/modules/apps/mentions/mentions-web-test/build/reports/tests/testIntegration/index.html
          
          > Task :apps:mentions:mentions-web-test:stopTestableTomcat
          

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yvonne.han Yvonne Han
              Reporter:
              jorge.diaz Jorge Diaz
              Participants of an Issue:
              Recent user:
              Yunlin "Steven" Sun
              Engineering Assignee:
              Jorge Diaz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                21 weeks, 6 days ago

                  Packages

                  Version Package
                  7.2.10 DXP FP11
                  7.2.10.3 DXP SP4
                  7.2.X
                  7.3.X
                  7.3.10 DXP FP1
                  7.3.10.1 DXP SP1
                  7.3.6 CE GA7
                  Master