Skip to content
This repository has been archived by the owner on Nov 20, 2021. It is now read-only.

LPS-88891 Use a ServiceTracker to obtain the ServletContext object to avoid lifecyle issues #1592

Closed
wants to merge 8 commits into from

Conversation

izaera
Copy link
Collaborator

@izaera izaera commented Jan 15, 2019

No description provided.

@liferay-continuous-integration
Copy link
Collaborator

To conserve resources, the PR Tester does not automatically run for every pull.

If your code changes were already tested in another pull, reference that pull in this pull so the test results can be analyzed.

If your pull was never tested, comment "ci:test" to run the PR Tester for this pull.

@izaera
Copy link
Collaborator Author

izaera commented Jan 15, 2019

ci:test

@liferay-continuous-integration
Copy link
Collaborator

❌ ci:test - 161 out of 183 jobs passed in 3 hours 9 minutes 58 seconds 20 ms

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 751e8c80b01444b7bc08ef4482e19baedce0caeb

Copied in Private Modules Branch:

Branch Name: master-private
Branch GIT ID: dc61c09e96ec6cba24254ad117d54a0a4ef93fac

161 out of 183 jobs PASSED

22 Failed Jobs:

161 Successful Jobs:
For more details click here.

Failures unique to this pull:

  1. test-portal-acceptance-pullrequest-batch(master)/source-format-jdk8
    Job Results:

    0 Tests Passed.
    1 Test Failed.

    1. AXIS_VARIABLE=0,label_exp=!master #262224
           [java] java.lang.Exception: Found 1 formatting issues:
           [java] 1: There should be a line break after '(': ./modules/apps/frontend-js/frontend-js-loader-modules-extender/src/main/java/com/liferay/frontend/js/loader/modules/extender/internal/npm/NPMResolverJSBundleTracker.java 61 (SourceCheck:JavaLineBreakCheck)
           [java] 
           [java] 	at com.liferay.source.formatter.SourceFormatter.format(SourceFormatter.java:414)
           [java] 	at com.liferay.source.formatter.SourceFormatter.main(SourceFormatter.java:241)
           [echo] The following error occurred while executing this line:
           [echo] /opt/dev/projects/github/liferay-portal/portal-impl/build.xml:673: Java returned: 1
            [get] Getting: http://test-1-5/job/test-portal-acceptance-pullrequest-batch(master)/AXIS_VARIABLE=0,label_exp=!master/262224//consoleText
            [get] To: /opt/dev/projects/github/liferay-portal/20190115135842888.txt
         [delete] Deleting: /opt/dev/projects/github/liferay-portal/20190115135842888.txt
         [delete] Deleting: /opt/dev/projects/github/liferay-portal/null1158006459.properties
      

      merge-test-results:
      [mkdir] Created dir: /opt/dev/projects/github/liferay-portal/test-results
      [junitreport] Processing /opt/dev/projects/github/liferay-portal/test-results/TESTS-TestSuites.xml to /tmp/null1372233714
      [junitreport] Loading stylesheet jar:file:/opt/java/ant/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
      [junitreport] Transform time: 2415ms
      [junitreport] Deleting: /tmp/null1372233714
      [echo] A report with all the test results can be found at test-results/html/index.html.
      [mkdir] Created dir: /opt/dev/projects/github/liferay-jenkins-ee/test-results
      [copy] Copying 1 file to /opt/dev/projects/github/liferay-jenkins-ee/test-results
      [echo]
      [echo] Ant GC log:
      [echo]
      [echo] Java HotSpot(TM) 64-Bit Server VM (25.121-b13) for linux-amd64 JRE (1.8.0_121-b13), built on Dec 12 2016 16:36:53 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
      [echo] Memory: 4k page, physical 16777216k(1048680k free), swap 2097152k(1378996k free)

  2. test-portal-acceptance-pullrequest-batch(master)/functional-upgrade-tomcat90-mariadb102-jdk8/0
    Job Results:

    0 Tests Passed.
    1 Test Failed.

    1. AXIS_VARIABLE=0,label_exp=!master #270491
      delete-liferay-home:
      [delete] Deleting directory /opt/dev/projects/github/liferay-portal/bundles/work
      [exec] ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/mariadb/data/mariadb.sock' (2)
      [echo] The following error occurred while executing this line:
      [echo] /opt/dev/projects/github/liferay-portal/build-test-batch.xml:340: The following error occurred while executing this line:
      [echo] /opt/dev/projects/github/liferay-portal/build-test-batch.xml:366: The following error occurred while executing this line:
      [echo] /opt/dev/projects/github/liferay-portal/build-test.xml:9473: exec returned: 1
      [get] Getting: http://test-1-4/job/test-portal-acceptance-pullrequest-batch(master)/AXIS_VARIABLE=0,label_exp=!master/270491//consoleText
      [get] To: /opt/dev/projects/github/liferay-portal/20190115141854749.txt
      [delete] Deleting: /opt/dev/projects/github/liferay-portal/20190115141854749.txt
      [delete] Deleting: /opt/dev/projects/github/liferay-portal/null983567775.properties
  3. test-portal-acceptance-pullrequest-batch(master)/integration-db2111-jdk8
    Job Results:

    3293 Tests Passed.
    1 Test Failed.

    1. AXIS_VARIABLE=0,label_exp=!master #269132
      1. PortalImplCanonicalURLTest.testCanonicalURLWithFriendlyURL
        junit.framework.AssertionFailedError: expected:<...t:8080/web/1tsunw1n/[]-/content-name> but was:<...t:8080/web/1tsunw1n/[home1/]-/content-name>
        at com.liferay.portal.util.PortalImplCanonicalURLTest.testCanonicalURLWithFriendlyURL(PortalImplCanonicalURLTest.java:161)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
        at com.liferay.portal.test.rule.LiferayIntegrationTestRule$1$1.evaluate(LiferayIntegrationTestRule.java:154)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$1.evaluate(BaseTestRule.java:61)
        at com.liferay.portal.kernel.test.rule.TimeoutTestRule$1.evaluate(TimeoutTestRule.java:89)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.java:81)
        at com.liferay.portal.kernel.test.rule.BaseTestRule$2.evaluate(BaseTestRule.jav...
  4. test-portal-acceptance-pullrequest-batch(master)/lpkg-base-jdk8
    Job Results:

    0 Tests Passed.
    1 Test Failed.

    1. AXIS_VARIABLE=0,label_exp=!master #273580
      delete-liferay-home:
      [delete] Deleting directory /opt/dev/projects/github/liferay-portal/bundles/work
      [delete] Deleting directory /tmp/sprite
      [exec] ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
      [echo] The following error occurred while executing this line:
      [echo] /opt/dev/projects/github/liferay-portal/build-test-batch.xml:340: The following error occurred while executing this line:
      [echo] /opt/dev/projects/github/liferay-portal/build-test-batch.xml:366: The following error occurred while executing this line:
      [echo] /opt/dev/projects/github/liferay-portal/build-test.xml:9473: exec returned: 1
      [get] Getting: http://test-1-14/job/test-portal-acceptance-pullrequest-batch(master)/AXIS_VARIABLE=0,label_exp=!master/273580//consoleText
      [get] To: /opt/dev/projects/github/liferay-portal/20190115141111718.txt
      [delete] Deleting: /opt/dev/projects/github/liferay-portal/20190115141111718.txt
      [delete] Deleting: /opt/dev/projects/github/liferay-portal/null503747671.properties
  5. ...

@adolfopa
Copy link

adolfopa commented Jan 15, 2019

@izaera Why not use a ServiceTrackerList in 49aeaeb (first commit)? I think that would make things slightly simpler.

Cheers!

@jbalsas
Copy link
Owner

jbalsas commented Jan 15, 2019

Pull request submitted to brianchandotcom#66748. See changes here.

:octocat: Sent from GH.

@izaera
Copy link
Collaborator Author

izaera commented Jan 16, 2019

@izaera Why not use a ServiceTrackerList in 49aeaeb (first commit)? I think that would make things slightly simpler.

Cheers!

A ServiceTrackerList wouldn't do the work because we need a way to defer the variable registration in case the ServletContext is not available when the JSBundle appears. So we are using the ServiceTracker as a kind of Promise more than as a real tracker.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants