Class ElasticTime

java.lang.Object
org.jenkinsci.test.acceptance.utils.ElasticTime

public class ElasticTime extends Object
Scale time measurement to support individual execution schemes.

Due to the nature of the harness, the framework is full of timeouts waiting for things to happen. Given the number of modes of execution, environments and configurations there is, there are no right timeouts to balance the desire to abort operations that takes too long and necessity not to interrupt operations taking a bit more time to complete successfully.

To reflect that, use -DElasticTime.factor and configure the factor to slow down / speed up the measured time for your executions. Floating point values are accepted too.

This implementation takes number of concurrent threads into account.

Author:
ogondza
  • Constructor Details

    • ElasticTime

      public ElasticTime()
  • Method Details

    • seconds

      public long seconds(long secs)
    • milliseconds

      public long milliseconds(long ms)
    • getSlowDownFactor

      public double getSlowDownFactor()
      Get the factor by which we slow down time. Default is 1.0 (no difference). Use >1 in case of slower environment, <1 in case of faster one.
      Returns:
      the factor by which we slow down time.