highstreet-technologies / transportpce

Mirror of the OpenDaylight transportpce gerrit project
1 stars 1 forks source link

improve integration test duration #3

Open jacksitlab opened 3 years ago

jacksitlab commented 3 years ago

Add a globals class which can be included by all transportpce subprojects (at least those with manual delays) and define these delay values there and so replace them with the variable values.

They should be the same as before, but overridable by env var

Maybe transportpce/common is the best location for this

Example

package org.opendaylight.transportpce.common;

public class Globals {

    public static int SLEEP_10000 = getEnvOrDefault(SLEEP_10000,10000);
}

private static int getEnvOrDefault(String envVar, int def) {
...
}

to find all sleep commands in the transportpce code

grep "Thread.sleep(" $(find -name *.java) | grep -v target