Skip to content
Permalink
Browse files

[FIXED JENKINS-25788] RunMap.remove was always returning false, even …

…when the Run was in fact removed.
  • Loading branch information...
jglick committed Dec 9, 2014
1 parent 96ecabe commit ce94579c50621990517c86120236ee9a1d0490da
@@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Spurious warnings in the log after deleting builds.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-25788">issue 25788</a>)
<li class=bug>
Master labels disappear when system configuration is updated.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-23966">issue 23966</a>)
@@ -746,7 +746,7 @@ public synchronized boolean removeValue(R run) {

entrySet.clearCache();

return unwrap(old)!=null;
return old != null;
}

/**
@@ -9,9 +9,6 @@
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.SleepBuilder;

/**
* @author Kohsuke Kawaguchi
*/
public class RunMapTest {

@Rule public JenkinsRule r = new JenkinsRule();
@@ -73,4 +70,21 @@ public Object readResolve() {

private static boolean bombed;

@Issue("JENKINS-25788")
@Test public void remove() throws Exception {
FreeStyleProject p = r.createFreeStyleProject();
FreeStyleBuild b1 = r.buildAndAssertSuccess(p);
FreeStyleBuild b2 = r.buildAndAssertSuccess(p);
RunMap<FreeStyleBuild> runs = p._getRuns();
assertEquals(2, runs.size());
assertTrue(runs.remove(b1));
assertEquals(1, runs.size());
assertFalse(runs.remove(b1));
assertEquals(1, runs.size());
assertTrue(runs.remove(b2));
assertEquals(0, runs.size());
assertFalse(runs.remove(b2));
assertEquals(0, runs.size());
}

}

2 comments on commit ce94579

@daniel-beck

This comment has been minimized.

Copy link
Member

replied Dec 23, 2014

I wonder why Github thinks this isn't in 1.595 when it's listed on https://github.com/jenkinsci/jenkins/commits/jenkins-1.595 -- anyone know why?

@jglick

This comment has been minimized.

Copy link
Member Author

replied Dec 23, 2014

Dunno. git describe --contains shows it.

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