Tuesday, 2 July 2019

Fix for Jenkins on Mac getting stuck on overnight builds




Every night my dutiful Jenkins build servers build their jobs and every morning I come in to find that a job on OSX has gotten stuck on 'git fetch' all night. The job's console output looks something like this:

[EnvInject] - Loading node environment variables.
Building in workspace /Users/me/Projects/MyProject
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is used...
[WS-CLEANUP] Done
using credential xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Cloning the remote Git repository
Cloning repository ssh://myname@website.org/repo.git
 > /usr/local/bin/git init /Users/me/Projects/MyProject# timeout=10
Fetching upstream changes from ssh://myname@website.org/repo.git
 > /usr/local/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials 
 > /usr/local/bin/git fetch --tags --progress ssh://myname@website.org/repo.git +refs/heads/*:refs/remotes/origin/*

Sometimes it starts again while you're looking at it, as if embarrassed to be caught slacking off all night.


Resolution:

This is because I turn off the display in the evening and the OSX build server server decides to go into sleep mode. Here's how to turn that feature off:


  1. Go the the Apple menu, select System Preferences then Energy Saver
  2. Check the box that says "Prevent computer from sleeping automatically when the display is off"

No comments:

Post a Comment

  Azure Trusted Signing Signtool Error SignTool Error: An unexpected internal error has occurred. Error information: "Error: SignerSign...