CI external-tape-format test failing sporadically
Summary
Title is self explanatory. This test is failing from time to time, for now it is pretty infrequent but we should address it at some point to not get to the same point that we got with queue cleanup
and eviction
where we had to disable some tests.
Steps to reproduce
Run the test in CI enough times to recreate the condition. It always fails, but some times it is reported as a success.
What is the current bug behaviour?
The test always fails randomly
What is the expected correct behaviour?
The test should not fail.
Relevant logs and/or screenshots
Sample failed job: https://gitlab.cern.ch/cta/CTA/-/jobs/39061179
This happens for successful and failed jobs...
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from OsmReaderTest
[ RUN ] OsmReaderTest.ReadOsmTape
unknown file: Failure
C++ exception with description "Could not open device file: -n Errno=2: No such file or directory
/usr/lib64/libctacommon.so.0(cta::exception::Backtrace::Backtrace(bool)+0x6b) [0x7f87ea6e272f]
/usr/lib64/libctacommon.so.0(cta::exception::Exception::Exception(std::basic_string_view<char, std::char_traits<char> >, bool)+0x91) [0x7f87ea6e3747]
/usr/lib64/libctacommon.so.0(cta::exception::Errnum::Errnum(int, std::basic_string_view<char, std::char_traits<char> >)+0x77) [0x7f87ea6e3181]
/usr/lib64/libctacommon.so.0(cta::exception::Errnum::Errnum(std::basic_string_view<char, std::char_traits<char> >)+0x4d) [0x7f87ea6e33b1]
/usr/lib64/libctacommon.so.0(cta::exception::Errnum::throwOnMinusOne(long, std::basic_string_view<char, std::char_traits<char> >)+0x5c) [0x7f87ea6e3628]
cta-osmReaderTest() [0x4a4b84]
cta-osmReaderTest() [0x4b816b]
cta-osmReaderTest() [0x4b82fb]
cta-osmReaderTest() [0x4a4567]
cta-osmReaderTest() [0x45dbe7]
cta-osmReaderTest() [0x458f79]
/usr/lib64/libgtest.so.1.11.0(+0x4fe0c) [0x7f87ec706e0c]
/usr/lib64/libgtest.so.1.11.0(testing::Test::Run()+0xd6) [0x7f87ec6e7826]
/usr/lib64/libgtest.so.1.11.0(testing::TestInfo::Run()+0x1a0) [0x7f87ec6e79f0]
/usr/lib64/libgtest.so.1.11.0(testing::TestSuite::Run()+0xd9) [0x7f87ec6e7af9]
/usr/lib64/libgtest.so.1.11.0(testing::internal::UnitTestImpl::RunAllTests()+0x4e5) [0x7f87ec6f6fc5]
/usr/lib64/libgtest.so.1.11.0(testing::UnitTest::Run()+0x1a8) [0x7f87ec6f47c8]
cta-osmReaderTest() [0x45b0a4]
cta-osmReaderTest() [0x459f6b]
/usr/lib64/libc.so.6(+0x3feb0) [0x7f87e4fddeb0]
/usr/lib64/libc.so.6(__libc_start_main+0x80) [0x7f87e4fddf60]
cta-osmReaderTest() [0x458e85]
" thrown in the test body.
[ FAILED ] OsmReaderTest.ReadOsmTape (18 ms)
[ RUN ] OsmReaderTest.CleanDrive
/builds/cta/CTA/build_rpm/RPM/BUILD/cta-5-7405460git8aba923b/tapeserver/castor/tape/tapeserver/file/OsmReaderTest.cpp:189: Failure
Expected: (std::string::npos) != (logToCheck.find("Cleaner successfully detected tape contains data")), actual: 18446744073709551615 vs 18446744073709551615
[ FAILED ] OsmReaderTest.CleanDrive (2 ms)
Possible causes
Race condition? mHVTL not configured in time before the test starts? There are several causes, see comments.Could not open device file: -n Errno=2: No such file or directory
Edited by Pablo Oliver Cortes