mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
[TEST] Minimize chance of thread pre-emption when testing fair locks.
Original commit: elastic/x-pack-elasticsearch@4d52f70e7f
This commit is contained in:
parent
93fee667ab
commit
9a044735dd
@ -101,7 +101,7 @@ public class WatchLockServiceTests extends ElasticsearchTestCase {
|
||||
|
||||
List<FairRunner> runners = new ArrayList<>();
|
||||
|
||||
for(int i = 0; i < 100; ++i) {
|
||||
for(int i = 0; i < 50; ++i) {
|
||||
FairRunner f = new FairRunner(i);
|
||||
runners.add(f);
|
||||
threads.add(new Thread(f));
|
||||
@ -110,7 +110,7 @@ public class WatchLockServiceTests extends ElasticsearchTestCase {
|
||||
for(int i = 0; i < threads.size(); ++i) {
|
||||
threads.get(i).start();
|
||||
runners.get(i).startLatch.await();
|
||||
Thread.sleep(10);
|
||||
Thread.sleep(25);
|
||||
}
|
||||
|
||||
for(Thread t : threads) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user