Skip to content

Commit

Permalink
Merge pull request #486 from jglick/FileDescriptorLimitTest-2
Browse files Browse the repository at this point in the history
More diagnostics for `FileDescriptorLimitTest` flake
  • Loading branch information
Dohbedoh committed Aug 8, 2023
2 parents 869b748 + 9f1bdf2 commit 0d62227
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.cloudbees.jenkins.support.util.SystemPlatform;
import hudson.Functions;
import hudson.model.FreeStyleProject;
import hudson.slaves.SlaveComputer;
import junit.framework.AssertionFailedError;
import org.apache.commons.io.IOUtils;
import org.hamcrest.MatcherAssert;
Expand Down Expand Up @@ -86,7 +87,7 @@ public void agentContentFilter() throws Exception {
Assume.assumeTrue(SystemPlatform.LINUX == SystemPlatform.current());
logging.record(AsyncResultCache.class, Level.FINER);
ContentFilters.get().setEnabled(true);
j.createOnlineSlave();
SlaveComputer agent = j.createOnlineSlave().getComputer();
File bundle = tmp.newFile("bundle.zip");
try (var os = new FileOutputStream(bundle)) {
SupportPlugin.writeBundle(os, List.of(new FileDescriptorLimit()));
Expand All @@ -96,7 +97,7 @@ public void agentContentFilter() throws Exception {
assertThat("worked on controller", IOUtils.toString(is, (String) null), containsString("All open files"));
}
try (var is = zf.getInputStream(zf.stream().filter(n -> n.getName().matches("nodes/slave/.+/file-descriptors[.]txt")).findFirst().get())) {
assertThat("worked on agent", IOUtils.toString(is, (String) null), containsString("All open files"));
assertThat("worked on agent\n" + agent.getLog(), IOUtils.toString(is, (String) null), containsString("All open files"));
}
}
}
Expand Down

0 comments on commit 0d62227

Please sign in to comment.