Skip to content

Commit

Permalink
Fix of JENKINS-8408 broke some tests of workspace-based polling; disa…
Browse files Browse the repository at this point in the history
…ble the fix when inside a test, for better predictability.

(Ideally Jenkins would actually detect whether there was a *plan* to connect a slave of a given name.)
  • Loading branch information
jglick committed Jun 9, 2014
1 parent 5e89373 commit 3ddef51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -1380,7 +1380,7 @@ private PollingResult _poll(TaskListener listener, SCM scm) throws IOException,
// give time for slaves to come online if we are right after reconnection (JENKINS-8408)
long running = Jenkins.getInstance().getInjector().getInstance(Uptime.class).getUptime();
long remaining = TimeUnit2.MINUTES.toMillis(10)-running;
if (remaining>0) {
if (remaining>0 && /* this logic breaks tests of polling */!Functions.getIsUnitTest()) {
listener.getLogger().print(Messages.AbstractProject_AwaitingWorkspaceToComeOnline(remaining/1000));
listener.getLogger().println( " (" + workspaceOfflineReason.name() + ")");
return NO_CHANGES;
Expand Down

0 comments on commit 3ddef51

Please sign in to comment.