Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-32102

Race condition in ContentTypeHandler

    XMLWordPrintable

Details

    Description

      Publishing Content Types in parallel can lead to a situation where one of the Content Types is not loaded in a ContentTypeService::loadContentTypes call, because it's missing in Persistence cache.

      Note:
      This steps to reproduce are meant for Platform v3, but I've seen the issue happen on Travis for v2 as well.

      Steps to reproduce:
      1. Place the file ContentTypeContext in tests/Behat
      2. Place the file demo.feature in features
      3. Modify behat.yml.dist (or behat.yml, if present):

          suites:
              default:
                  contexts:
                      - App\Tests\Behat\DemoContext
                      - App\Tests\Behat\ContentTypeContext
                      - EzSystems\Behat\API\Context\TestContext
      

      4. Run in console:

      export APP_ENV=behat
      export APP_DEBUG=1
      

      5. Run tests in parallel:

      bin/behat --list-scenarios | bin/fastest -o -v "bin/behat -vv"
      

      Expected:
      All tests pass

      Actual:
      Even though all tests are the same, some of them fail with:

              Failed asserting that an array contains 'content_type_identifier_X'.
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            marek.nocon@ibexa.co Marek Nocoń
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: