Skip to content

Commit

Permalink
Skip LogRotatorTest#ableToDeleteCurrentBuild on Windows (#9923)
Browse files Browse the repository at this point in the history
* Skip `LogRotatorTest#ableToDeleteCurrentBuild` on Windows

* Also remove BuildWatcher from LogRotatorTest in case it was contributing to flakiness
  • Loading branch information
dwnusbaum authored Nov 2, 2024
1 parent 1892e21 commit bec45d7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/src/test/java/hudson/tasks/LogRotatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;

import hudson.Functions;
import hudson.Launcher;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
Expand All @@ -50,10 +52,8 @@
import java.util.concurrent.TimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.BuildWatcher;
import org.jvnet.hudson.test.FailureBuilder;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
Expand All @@ -64,9 +64,6 @@
*/
public class LogRotatorTest {

@ClassRule
public static BuildWatcher watcher = new BuildWatcher();

@Rule
public JenkinsRule j = new JenkinsRule();

Expand Down Expand Up @@ -103,6 +100,8 @@ public void successVsFailureWithRemoveLastBuild() throws Exception {

@Test
public void ableToDeleteCurrentBuild() throws Exception {
assumeFalse("Deleting the current build while is is completing does not work consistently on Windows",
Functions.isWindows());
var p = j.createFreeStyleProject();
// Keep 0 builds, i.e. immediately delete builds as they complete.
LogRotator logRotator = new LogRotator(-1, 0, -1, -1);
Expand Down

0 comments on commit bec45d7

Please sign in to comment.