mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 11:03:36 +08:00
The current version of the BGW scheduler mock does not support multiple background workers. If a second worker was registered, the reference to the previously registered worker gets lost. So, the implementation of the mock scheduler only waits for the latest registered worker before updating the mocked current time, which causes a race condition. If the previous workers are still active and logging messages after this point, the messages are logged with the updated mocked time. This leads to a non-deterministic behavior and test failures. For example: msg_no | mock_time | application_name | msg ---------+-----------+-------------------------+---------------------- - 1 | 0 | Retention Policy [1002] | job 1002 [...] [...] + 1 | 1000000 | Retention Policy [1002] | job 1002 [...]