rocksdb/test_util
Cheng Chang 46516778dd Fix flaky test DecreaseNumBgThreads (#6393)
Summary:
The DecreaseNumBgThreads test keeps failing on Windows in AppVeyor.
It fails because it depends on a timed wait for the tasks to be dequeued from the threadpool's internal queue, but within the specified time, the task might have not been scheduled onto the newly created threads.
https://github.com/facebook/rocksdb/pull/6232 tries to fix this by waiting for longer time to let the threads scheduled.
This PR tries to fix this by replacing the timed wait with a synchronization on the task's internal conditional variable.
When the number of threads increases, instead of guessing the time needed for the task to be scheduled, it directly blocks on the conditional variable until the task starts running.
But when thread number is reduced, it still does a timed wait, but this does not lead to the flakiness now, will try to remove these timed waits in a future PR.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6393

Test Plan: Wait to see whether AppVeyor tests pass.

Differential Revision: D19890928

Pulled By: cheng-chang

fbshipit-source-id: 4e56e4addf625c98c0876e62d9d57a6f0a156f76
2020-02-13 17:27:18 -08:00
..
fault_injection_test_env.cc Fix ingested file and direcotry not being sync (#5435) 2019-06-21 10:15:38 -07:00
fault_injection_test_env.h Fix ingested file and direcotry not being sync (#5435) 2019-06-21 10:15:38 -07:00
mock_time_env.h Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
sync_point.cc Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
sync_point.h Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
sync_point_impl.cc Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
sync_point_impl.h Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
testharness.cc Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
testharness.h Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00
testutil.cc Add an option to prevent DB::Open() from querying sizes of all sst files (#6353) 2020-02-04 01:27:26 -08:00
testutil.h Fix flaky test DecreaseNumBgThreads (#6393) 2020-02-13 17:27:18 -08:00
transaction_test_util.cc Apply formatter to recent 200+ commits. (#5830) 2019-09-20 12:04:26 -07:00
transaction_test_util.h Move test related files under util/ to test_util/ (#5377) 2019-05-30 11:25:51 -07:00