You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Test] Reduce amount of work and concurrency for test stability (#91489) (#91534)
The test fails from time to time because not every thread finishes the
work within 1 second of waiting time. It is possible that the work is
just sometimes taking too long to complete. The getBitSet method
internally acquires a read lock, have concurrent read/write access to
cache, concurrentHashMap, atomicLong and a log call that may go to the
disk. It is possible some of these can be stalled and the delay
accumulates to exceed more than 1 second.
This PR reduces the amount of work by decrease the number of loops and
reduces the concurrency by having less maximum number of concurrent
threads. It also catches any exception that gets thrown in the worker
threads and report it when the test fails (otherwise, the exception is
swallow and the final failure shows only timeout).
The test took quite long (1m20s on locally) to complete even with when
concurrentThreads and numberOfIndices are randomized to be the minimum
(5 and 3 respectively). With the reduction, it now takes 28 seconds
which is also a gain. Because how long the test takes, it is also viable
in the future to bump the wait time should it fails again.
Resolves: #91471
Copy file name to clipboardExpand all lines: x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/DocumentSubsetBitsetCacheTests.java
+26-15Lines changed: 26 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -359,13 +359,12 @@ public void testIndexLookupIsClearedWhenBitSetIsEvicted() throws Exception {
0 commit comments