mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-10 10:36:21 +00:00
Queue.clearLeftItems to fix AbstractProjectTest.testGetBuildAfterGC test failure after 84a2593.
This commit is contained in:
1 parent
aec064adc5
commit
e67746c97f
2 files changed
+10
-4
No files matched your search
@@ -92,10 +92,6 @@ import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.TreeSet;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.Future;
|
||||
@@ -748,6 +744,15 @@ public class Queue extends ResourceController implements Saveable {
|
||||
return Collections.unmodifiableCollection(leftItems.asMap().values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Immediately clear the {@link #getLeftItems} cache.
|
||||
* Useful for tests which need to verify that no links to a build remain.
|
||||
* @since 1.519
|
||||
*/
|
||||
public void clearLeftItems() {
|
||||
leftItems.invalidateAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all items that are in the queue but not blocked
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user