Skip to content

tests fail randomly if ctest is called with -jN #2906

@rathann

Description

@rathann

Describe the bug
A couple of tests fail randomly when they are run in parallel, i.e. with ctest -jN.

AGS Version
3.6.2.14

Game
N/A

To Reproduce
Steps to reproduce the behavior:

  1. Build ags with these options (not sure if Fedora package options are relevant)
  2. Run tests with ctest --output-on-failure --force-new-ctest-process -j4 --output-on-failure
  3. See tests fail randomly in subsequent runs, e.g. FileBasedTest.BufferedSectionStream, FileBasedTest.BufferedStreamWrite3, FileBasedTest.BufferedStreamWrite4, FileBasedTest.BufferedStreamWrite5

Expected behavior
Tests should always pass.

Screenshots

 21/141 Test  #20: FileBasedTest.BufferedStreamRead ...............***Failed    0.00 sec
Running main() from /builddir/build/BUILD/gtest-1.15.2-build/googletest-1.15.2/googletest/src/gtest_main.cc
Note: Google Test filter = FileBasedTest.BufferedStreamRead
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from FileBasedTest
[ RUN      ] FileBasedTest.BufferedStreamRead
unknown file: Failure
C++ exception with description "Error opening file." thrown in the test body.
[  FAILED  ] FileBasedTest.BufferedStreamRead (0 ms)
 23/141 Test  #23: FileBasedTest.BufferedStreamWrite3 .............***Failed    0.01 sec
Running main() from /builddir/build/BUILD/gtest-1.15.2-build/googletest-1.15.2/googletest/src/gtest_main.cc
Note: Google Test filter = FileBasedTest.BufferedStreamWrite3
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from FileBasedTest
[ RUN      ] FileBasedTest.BufferedStreamWrite3
/builddir/build/BUILD/ags-3.6.2.14-build/ags-3.6.2.14/Common/test/stream_test.cpp:475: Failure
Expected equality of these values:
  in.GetLength()
    Which is: 0
  file_len
    Which is: 40
[  FAILED  ] FileBasedTest.BufferedStreamWrite3 (0 ms)
 24/141 Test  #24: FileBasedTest.BufferedStreamWrite4 .............***Failed    0.01 sec
Running main() from /builddir/build/BUILD/gtest-1.15.2-build/googletest-1.15.2/googletest/src/gtest_main.cc
Note: Google Test filter = FileBasedTest.BufferedStreamWrite4
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from FileBasedTest
[ RUN      ] FileBasedTest.BufferedStreamWrite4
unknown file: Failure
C++ exception with description "Error opening file." thrown in the test body.
[  FAILED  ] FileBasedTest.BufferedStreamWrite4 (0 ms)
 25/141 Test  #25: FileBasedTest.BufferedStreamWrite5 .............***Failed    0.01 sec
Running main() from /builddir/build/BUILD/gtest-1.15.2-build/googletest-1.15.2/googletest/src/gtest_main.cc
Note: Google Test filter = FileBasedTest.BufferedStreamWrite5
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from FileBasedTest
[ RUN      ] FileBasedTest.BufferedStreamWrite5
unknown file: Failure
C++ exception with description "Error opening file." thrown in the test body.

[  FAILED  ] FileBasedTest.BufferedStreamWrite5 (1 ms)

Desktop (please complete the following information):

  • OS: Fedora Linux
  • Version: 44 (rawhide) and 43

Additional information:
Tests pass if I run them sequentially, i.e. with ctest -j1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugunexpected/erroneous behavior in the existing functionality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions