[MXS-4195] test_atomic times out intermittently during packaging Created: 2022-07-07  Updated: 2022-07-15  Resolved: 2022-07-15

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 2.5.20
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

The test_atomic test seems to time out from time to time which causes builds to fail. Repeated local tests have revealed no problems which could suggest the problem is related to the build environment.



 Comments   
Comment by markus makela [ 2022-07-08 ]

Stacktrace from a test run:

/lib/x86_64-linux-gnu/libpthread.so.0(+0x9cd7): ??:?
nm: /lib/x86_64-linux-gnu/libstdc++.so.6: no symbols
/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6thread4joinEv+0x17): ??:0
/home/timofey_turenko_mariadb_com/MaxScale/_build/server/core/test/test_atomic(_Z8run_testPFvPvE+0x11e): server/core/test/test_atomic.cc:117 (discriminator 2)
/home/timofey_turenko_mariadb_com/MaxScale/_build/server/core/test/test_atomic(main+0x70): server/core/test/test_atomic.cc:137
nm: /lib/x86_64-linux-gnu/libc.so.6: no symbols
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3): ??:0
/home/timofey_turenko_mariadb_com/MaxScale/_build/server/core/test/test_atomic(_start+0x2e): ??:?

Comment by markus makela [ 2022-07-08 ]

The test is faulty as it expects all threads to complete their tasks in some given order. If the previous thread ends up not executing the code that is expected and returns earlier than the current thread (a perfectly valid outcome) the test ends up waiting for the previous thread to assign the ID value to the current thread. Since the loop doesn't check for the flag that tells the test to stop, it ends up timing out.

Since the atomic_cas_ptr function isn't used anywhere, it might as well be removed along with the test case for it.

Comment by markus makela [ 2022-07-15 ]

Fixed the test for 2.5.21.

Generated at Thu Feb 08 04:26:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.