When we are contended, we should try and execute tests on a first-come
first-serve basis.
JIRA: ODLPARENT-262
Change-Id: I68e45bb9d0f59130083c188c19617e1a91636234
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
topContext = session.getPluginContext(STATIC_DESCRIPTOR, session.getTopLevelProject());
}
- final var lock = (Lock) topContext.computeIfAbsent("lock", key -> new ReentrantLock());
+ // Note: we are using a fair lock to get first-come, first-serve rather than some unpredictable order
+ final var lock = (Lock) topContext.computeIfAbsent("lock", key -> new ReentrantLock(true));
LOG.debug("Using lock {}", lock);
try {
lock.lockInterruptibly();