Skip to content
Permalink
Browse files

[FIXED JENKINS-25655] Incorrect caching from entrySet sometimes cause…

…d incorrect results.

Caused a failure in hudson.plugins.promoted_builds.conditions.ManualConditionTest.testManualPromotionProcessViaWebClient when run against 1.580.1.
  • Loading branch information...
jglick committed Nov 17, 2014
1 parent 1568166 commit b76e7bf9988ebf5b3b7e2c5e588d5ce6dbde957e
@@ -585,6 +585,8 @@ public synchronized R put(Integer key, R r) {
numberOnDisk = a;
}

entrySet.clearCache();

return unwrap(old);
}

@@ -742,6 +744,8 @@ public synchronized boolean removeValue(R run) {
BuildReference<R> old = copy.byId.remove(getIdOf(run));
this.index = copy;

entrySet.clearCache();

return unwrap(old)!=null;
}

@@ -32,6 +32,10 @@
return all;
}

synchronized void clearCache() {
all = null;
}

@Override
public int size() {
return all().size();
@@ -414,6 +414,13 @@ public void entrySetSize() {
assertEquals(0, b.entrySet().size());
}

@Issue("JENKINS-25655")
@Test public void entrySetChanges() {
assertEquals(3, a.entrySet().size());
a.put(new Build(7, "D"));
assertEquals(4, a.entrySet().size());
}

@Issue("JENKINS-18065")
@Test
public void entrySetContains() {

0 comments on commit b76e7bf

Please sign in to comment.
You can’t perform that action at this time.