Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-28968

Fix LogTestWatchman usage in functional tests

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 11.1-SNAPSHOT
    • Fix Version/s: 11.1, 2021.0
    • Component/s: Tests
    • Tags:
    • Team:
      AT
    • Sprint:
      nxAT 11.1.15, nxAT 11.1.16
    • Story Points:
      1

      Description

      Class LogTestWatchman.java is mostly useful (besides taking screenshots in case of failures) to issue logs on the server, so that we can match potential server logs with corresponding tests.

      Currently this class is unefficient and shows, in the tests output:

      [INFO] Running org.nuxeo.ftest.server.ITStartupPageTest
      2020-04-22 03:57:31,004 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITStartupPageTest#testStartupPage'
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.412 s - in org.nuxeo.ftest.server.ITStartupPageTest
      [INFO] Running org.nuxeo.ftest.server.ITOAuth2Test
      2020-04-22 03:57:36,906 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITOAuth2Test#testAuthorizationDenied'
      2020-04-22 03:57:39,813 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITOAuth2Test#testAuthorizationErrors'
      2020-04-22 03:57:41,563 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITOAuth2Test#testAuthorizationOnCMIS'
      2020-04-22 03:57:44,730 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITOAuth2Test#testAuthorizationOnRestAPI'
      2020-04-22 03:57:46,682 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITOAuth2Test#testOAuth2GrantPage'
      2020-04-22 03:57:47,737 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITOAuth2Test#testAuthorizationWithAutoGrant'
      2020-04-22 03:57:49,305 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITOAuth2Test#testAuthorizationSubmitErrors'
      2020-04-22 03:57:52,596 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITOAuth2Test#testTokenGetRequest'
      2020-04-22 03:57:53,120 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITOAuth2Test#testAuthorizationGranted'
      2020-04-22 03:57:54,713 [main] WARN  [LogTestWatchman] Cannot log on server message: Starting test 'org.nuxeo.ftest.server.ITOAuth2Test#testAuthorizationWithExistingToken'
      [INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 20.293 s - in org.nuxeo.ftest.server.ITOAuth2Test
      [INFO] Running org.nuxeo.ftest.server.ITRestAPITest
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.095 s - in org.nuxeo.ftest.server.ITRestAPITest
      [INFO] 
      [INFO] Results:
      [INFO] 
      [INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0
      

      Server logs show warnings that are difficult to match to tests:

      ======================================================================
      = Component Loading Status: Pending: 0 / Missing: 0 / Unstarted: 0 / Total: 539
      ======================================================================
      2020-04-22T03:57:40,192 WARN  [http-nio-0.0.0.0-8080-exec-13] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Missing required field "client_id".)
      2020-04-22T03:57:40,528 WARN  [http-nio-0.0.0.0-8080-exec-1] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Missing required field "response_type".)
      2020-04-22T03:57:40,606 WARN  [http-nio-0.0.0.0-8080-exec-10] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=unsupported_response_type, description=Unknown response_type: got "unknown", expecting "code".)
      2020-04-22T03:57:40,704 WARN  [http-nio-0.0.0.0-8080-exec-4] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Invalid client_id: unknown.)
      2020-04-22T03:57:40,793 WARN  [http-nio-0.0.0.0-8080-exec-6] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Invalid redirect_uri parameter: unknown. It must exactly match one of the redirect URIs configured for the app.)
      2020-04-22T03:57:40,884 WARN  [http-nio-0.0.0.0-8080-exec-11] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Invalid PKCE parameters: either both code_challenge and code_challenge_method parameters must be sent or none of them.)
      2020-04-22T03:57:40,960 WARN  [http-nio-0.0.0.0-8080-exec-3] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Invalid PKCE parameters: either both code_challenge and code_challenge_method parameters must be sent or none of them.)
      2020-04-22T03:57:41,056 WARN  [http-nio-0.0.0.0-8080-exec-2] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Invalid code_challenge_method parameter: transform algorithm unknown not supported. The server only supports [plain, S256].)
      2020-04-22T03:57:49,767 WARN  [http-nio-0.0.0.0-8080-exec-5] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=The /oauth2/authorize_submit endpoint only accepts POST requests.)
      2020-04-22T03:57:50,118 WARN  [http-nio-0.0.0.0-8080-exec-13] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Missing required field "client_id".)
      2020-04-22T03:57:50,458 WARN  [http-nio-0.0.0.0-8080-exec-10] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Missing required field "response_type".)
      2020-04-22T03:57:50,780 WARN  [http-nio-0.0.0.0-8080-exec-6] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=unsupported_response_type, description=Unknown response_type: got "unknown", expecting "code".)
      2020-04-22T03:57:50,997 WARN  [http-nio-0.0.0.0-8080-exec-3] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Invalid client_id: unknown.)
      2020-04-22T03:57:51,196 WARN  [http-nio-0.0.0.0-8080-exec-7] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Invalid redirect_uri parameter: unknown. It must exactly match one of the redirect URIs configured for the app.)
      2020-04-22T03:57:51,509 WARN  [http-nio-0.0.0.0-8080-exec-5] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Invalid PKCE parameters: either both code_challenge and code_challenge_method parameters must be sent or none of them.)
      2020-04-22T03:57:51,824 WARN  [http-nio-0.0.0.0-8080-exec-13] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Invalid PKCE parameters: either both code_challenge and code_challenge_method parameters must be sent or none of them.)
      2020-04-22T03:57:52,109 WARN  [http-nio-0.0.0.0-8080-exec-10] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=Invalid code_challenge_method parameter: transform algorithm unknown not supported. The server only supports [plain, S256].)
      2020-04-22T03:57:52,611 WARN  [http-nio-0.0.0.0-8080-exec-2] [org.nuxeo.ecm.platform.oauth2.NuxeoOAuth2Servlet] OAuth2 authorization request error: OAuth2Error(id=invalid_request, description=The /oauth2/token endpoint only accepts POST requests.)
      

      (example taken from https://qa.nuxeo.org/jenkins/view/P1Fail/job/Deploy/job/IT-nuxeo-master-tests-cap-tomcat/338/consoleText, same visible at https://qa.nuxeo.org/jenkins/view/P1Fail/job/master/job/nuxeo-packages-master/453/consoleText)

      The reason behind this warn log is that the client tries to hit the /restAPI/systemLog API that has been removed from the server (TODO: maybe link to corresponding jira)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h