File tree 1 file changed +11
-2
lines changed
src/test/java/org/jenkinsci/plugins/docker/workflow
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 41
41
42
42
import hudson .util .VersionNumber ;
43
43
import java .io .IOException ;
44
+ import java .lang .reflect .Field ;
44
45
import java .util .Set ;
45
46
import org .apache .commons .fileupload .FileItem ;
46
47
import org .apache .commons .io .FileUtils ;
@@ -180,8 +181,16 @@ public class WithContainerStepTest {
180
181
" sh \" sleep 5; ps -e -o pid,command | egrep '${pwd tmp: true}/durable-.+/script.sh' | fgrep -v grep | sort -n | tr -s ' ' | cut -d ' ' -f2 | xargs kill -9\" \n " +
181
182
" }\n " +
182
183
"}" , true ));
183
- WorkflowRun b = story .j .assertBuildStatus (Result .FAILURE , p .scheduleBuild2 (0 ).get ());
184
- story .j .assertLogContains ("script returned exit code -1" , b );
184
+ Field hci = BourneShellScript .class .getDeclaredField ("HEARTBEAT_CHECK_INTERVAL" );
185
+ hci .setAccessible (true );
186
+ int orig = (int ) hci .get (null );
187
+ hci .set (null , 5 );
188
+ try {
189
+ WorkflowRun b = story .j .assertBuildStatus (Result .FAILURE , p .scheduleBuild2 (0 ).get ());
190
+ story .j .assertLogContains ("script returned exit code -1" , b );
191
+ } finally {
192
+ hci .set (null , orig );
193
+ }
185
194
}
186
195
});
187
196
}
You can’t perform that action at this time.
0 commit comments