Skip to content

Commit 8ee0788

Browse files
committed
[JENKINS-54566] Reproducing warning sometimes from FileLogStorageTest.
1 parent 57eb03e commit 8ee0788

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/java/org/jenkinsci/plugins/workflow/log/LogStorageTestBase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ protected static void close(TaskListener listener) throws Exception {
152152
VirtualChannel channel = r.createOnlineSlave().getChannel();
153153
channel.call(new RemotePrint("overall from agent", overall));
154154
channel.call(new RemotePrint("step from agent", step));
155+
channel.call(new GC());
155156
overallPos = assertOverallLog(overallPos, "overall from agent\n<span class=\"pipeline-node-1\">step from agent\n</span>", true);
156157
stepPos = assertStepLog("1", stepPos, "step from agent\n", true);
157158
assertEquals(overallPos, assertOverallLog(overallPos, "", true));
@@ -173,6 +174,13 @@ private static final class RemotePrint extends MasterToSlaveCallable<Void, Excep
173174
return null;
174175
}
175176
}
177+
private static final class GC extends MasterToSlaveCallable<Void, Exception> {
178+
@Override public Void call() throws Exception {
179+
System.gc();
180+
System.runFinalization();
181+
return null;
182+
}
183+
}
176184

177185
/**
178186
* Checks what happens when code using {@link TaskListener#getLogger} prints a line with inadequate synchronization.

0 commit comments

Comments
 (0)