Skip to content
Snippets Groups Projects
Commit 1b854d99 authored by MichaelThomas-1's avatar MichaelThomas-1
Browse files

Updated test counter

- File includes timestamp for use in determining which batch it belongs to
- Removed old runCount.txt file
parent 8857f653
No related branches found
No related tags found
No related merge requests found
Pipeline #59173 passed
...@@ -37,6 +37,8 @@ public class Fuzzer { ...@@ -37,6 +37,8 @@ public class Fuzzer {
private static final int VAR_MAX = 2147483647; private static final int VAR_MAX = 2147483647;
// Maximum number of items in stack // Maximum number of items in stack
private static final int MAX_STACK_SIZE = 512; private static final int MAX_STACK_SIZE = 512;
// Maxiumum time difference for different executions to be counted as apart of the same batch of tests
private static final long MAX_TIME_DIFF = 5000; // Should be 5 seconds
// Random number generator // Random number generator
private static Random rand = new Random(System.currentTimeMillis()); private static Random rand = new Random(System.currentTimeMillis());
...@@ -82,9 +84,14 @@ public class Fuzzer { ...@@ -82,9 +84,14 @@ public class Fuzzer {
private static int getRun(){ private static int getRun(){
int runCount = 0; int runCount = 0;
long curTime = System.currentTimeMillis();
try { try {
Scanner input = new Scanner(new File("runCount.txt")); Scanner input = new Scanner(new File("runCount.txt"));
runCount = input.nextInt() + 1; runCount = input.nextInt() + 1;
long runTime = input.nextLong();
if (curTime - runTime > MAX_TIME_DIFF) {
runCount = 0;
}
} catch (Exception e){ } catch (Exception e){
// Carry on // Carry on
} }
...@@ -100,6 +107,8 @@ public class Fuzzer { ...@@ -100,6 +107,8 @@ public class Fuzzer {
pw = new PrintWriter(out); pw = new PrintWriter(out);
pw.print(runCount); pw.print(runCount);
pw.print(" ");
pw.print(System.currentTimeMillis());
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(System.err); e.printStackTrace(System.err);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment