Class LocalSlaveController

All Implemented Interfaces:
Closeable, AutoCloseable, AutoCleaned, CapybaraPortingLayer

public class LocalSlaveController extends SlaveController
Launches slaves locally on the same box as the Jenkins master.
Author:
Kohsuke Kawaguchi
  • Constructor Details

    • LocalSlaveController

      public LocalSlaveController()
  • Method Details

    • install

      public Future<Slave> install(Jenkins jenkins)
      Description copied from class: SlaveController
      Uses the given page object to create a new node and connect the slave to that Jenkins instance.

      Since the actual launch of slave can take some time and it often involves a busy loop until the slave gets fully launched, this method returns Future and it can return before the slave is fully connected.

      However, this does not mean the setup process can run entirely in another thread, as WebDriver do not support concurrent use by multiple threads.

      For example, SSH slaves might synchronously interact with Jenkins to create a slave, and let Jenkins begin connecting to it, but this method would return without waiting for the slave to fully come online. Then later when Future.get() method is invoked, it'll check back the slave status and block until the slave becomes online.

      This design improves the speed of connecting multiple slaves.

      TODO: for EC2 based providers where there's also another initial delay of allocating a new machine, this abstraction doesn't hide all the latencies sufficiently.

      When the Future.get() method returns successfully, the slave is fully online and ready to use.

      Specified by:
      install in class SlaveController
    • close

      public void close() throws IOException
      Description copied from class: SlaveController
      Convey the intention that this machine is no longer needed. The implementation will releases this machine / recycle the machine, etc.

      Once this method is called, no other methods should be called.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class SlaveController
      Throws:
      IOException