Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-2123

Tests sometimes fail when run in parallel, due to race conditions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2.0
    • 3.2.1
    • Samples/Tests
    • None
    • Debian GNU/Linux unstable, using the autotools build
    • Patch

    Description

      When using the autotools build and running make with the -j flag (to build in parallel), tests randomly fail. There seem to be two main causes.

      The first is a race condition between when the "observed" directory is tested for existence and when it is created. Adding the -p flag to mkdir allows it to ignore failure on the exiting directory.

      The second is that most of the ThreadTest tests are being written to the same logfile (ThreadTest1.log). This causes write contention and all sorts of odd results. Using separate logs for each test removes allows the writes to happen in any order without conflicting.

      Patch attached.

      Attachments

        1. fix_parallel_tests.diff
          5 kB
          Bill Blough

        Activity

          People

            rleigh Roger Leigh
            billblough Bill Blough
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: