Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-858

HttpClientMock2 not enabled due to race condition

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • TBD
    • Resolution: Done
    • 33.0.1
    • 33.0.2
    • None
    • CP: sprint 116
    • 1
    • Core: Platform

    Description

      Steps to Reproduce:

      1. Building or releasing mod-user-import master fails when run locally from the shell

      The unit tests succeed when run from IDE and on Jenkins.

      Cause is a race condition:
      https://github.com/folio-org/raml-module-builder/blob/v33.0.1/domain-models-runtime/src/main/java/org/folio/rest/RestVerticle.java#L114-L119
      https://github.com/folio-org/raml-module-builder/blob/v33.0.1/domain-models-runtime/src/main/java/org/folio/rest/tools/client/HttpClientFactory.java#L17-L21

      Mocking can be enabled by setting a Verticle DeploymentOption. RestVerticle reads it and passes this information to HttpClientFactory by setting a system property.
      HttpClientFactory checks the system property when the class loader loads the HttpClientFactory class, this might be before RestVerticle sets the system property (race condition).

      Solution: RestVerticle should also programmatically enable mocking in HttpClientFactory.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                julianladisch Julian Ladisch
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases