MySQL 8.4.2
Source Code Documentation
Thread Synchronization in Test Cases

The Debug Sync facility allows placement of synchronization points in the code.

They can be activated by statements that set the debug_sync system variable. An active synchronization point can emit a signal or wait for a signal to be emitted by another thread. This waiting times out after 300 seconds by default. The --debug-sync-timeout=N option for mysql-test-run.pl changes that timeout to N seconds. A timeout of zero disables the facility altogether, so that synchronization points will not emit or wait for signals, even if activated.

The purpose of the timeout is to avoid a complete lockup in test cases. If for some reason the expected signal is not emitted by any thread, the execution of the affected statement will not block forever. A warning shows up when the timeout happens. That makes a difference in the test result so that it will not go undetected.

For test cases that require the Debug Sync facility, include the following line in the test case file:

--source include/have_debug_sync.inc

For a description of the Debug Sync facility and how to use synchronization points, see MySQL Source Code Documentation: Thread Synchronization.