Skip to content

Commit ffe1f1a

Browse files
committed
CpsScriptTest.methodTooLargeExceptionRealistic(): reduce iteration count to satisfy different CI platforms
Signed-off-by: Jim Klimov <[email protected]>
1 parent df2b78f commit ffe1f1a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

plugin/src/test/java/org/jenkinsci/plugins/workflow/cps/CpsScriptTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,14 @@ public void evaluateShallSandbox() throws Exception {
110110
WorkflowJob p = r.createProject(WorkflowJob.class);
111111
StringBuffer sbMethods = new StringBuffer();
112112
StringBuffer sbStages = new StringBuffer();
113-
int i, max = 255;
114113

115-
for (i = 0; i < 250; i++) {
116-
// Up to 255 stages allowed
114+
// Limits to the "max":
115+
// * java.lang.StackOverflowError varies per JDK platform
116+
// (CI on Linux was unhappy with 255, on Windows with 1023)
117+
// * Up to 255 stages allowed
118+
int i, max = 200;
119+
120+
for (i = 0; i < max; i++) {
117121
sbStages.append("stage('Stage " + i + "') { steps { method" + i + "(); } }\n");
118122
}
119123

0 commit comments

Comments
 (0)