Skip to content

Commit

Permalink
Allow the fuzzer to run for a longer time
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan committed Sep 6, 2024
1 parent ab43a14 commit 9ab00b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Runner/Jobs/FuzzLibrariesJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ private async Task RunFuzzersAsync(string fuzzerNamePattern)

await LogAsync($"Matched: {string.Join(", ", matchingFuzzers)}");

int maxDurationPerFuzzer = TryGetFlag("long") ? int.MaxValue : 3600;

for (int i = 0; i < matchingFuzzers.Length; i++)
{
string fuzzerName = matchingFuzzers[i];

int remainingFuzzers = matchingFuzzers.Length - i;
TimeSpan remainingTime = MaxJobDuration - ElapsedTime - TimeSpan.FromMinutes(5);
int durationSeconds = (int)(remainingTime / remainingFuzzers).TotalSeconds;
durationSeconds = Math.Min(3600, durationSeconds);

ArgumentOutOfRangeException.ThrowIfLessThan(durationSeconds, 60);
durationSeconds = Math.Clamp(durationSeconds, 60, maxDurationPerFuzzer);

await RunFuzzerAsync(fuzzerName, durationSeconds);
}
Expand Down
1 change: 1 addition & 0 deletions Runner/Runner.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Runner", "Runner.csproj", "
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{52B8729C-24EE-4E9C-87FC-1F16B1D3A0E5}"
ProjectSection(SolutionItems) = preProject
..\azure-pipelines.yml = ..\azure-pipelines.yml
..\.github\workflows\run-script.yml = ..\.github\workflows\run-script.yml
EndProjectSection
EndProject
Expand Down

0 comments on commit 9ab00b0

Please sign in to comment.