From 5caee9096936d0d08828a8b39e443ecaa5b73304 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 26 Nov 2019 15:47:45 +0100 Subject: [PATCH] [xharness] Add a timeout to the periodic command. This will hopefully prevent the periodic command from keeping xharness alive longer than it should. --- tests/xharness/Jenkins.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index f878286fbb08..0db364bb87af 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -1120,14 +1120,13 @@ async Task PopulateTasksAsync () async Task ExecutePeriodicCommandAsync (Log periodic_loc) { - //await Task.Delay (Harness.UploadInterval); periodic_loc.WriteLine ($"Starting periodic task with interval {Harness.PeriodicCommandInterval.TotalMinutes} minutes."); while (true) { var watch = Stopwatch.StartNew (); using (var process = new Process ()) { process.StartInfo.FileName = Harness.PeriodicCommand; process.StartInfo.Arguments = Harness.PeriodicCommandArguments; - var rv = await process.RunAsync (periodic_loc, null); + var rv = await process.RunAsync (periodic_loc, timeout: Harness.PeriodicCommandInterval); if (!rv.Succeeded) periodic_loc.WriteLine ($"Periodic command failed with exit code {rv.ExitCode} (Timed out: {rv.TimedOut})"); }