ts: make unit tests independent from CPU load
When multiple unit tests run in parallel, tests that depend on timing synchronization might fail when the CPU is overloaded.
This MR aims at making sure the tests no longer depend on timing synchronizations.
Edited by François Laignel