Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/xharness/Jenkins.cs
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ public int Run ()
populating = false;
}).Wait ();
GenerateReport ();
BuildTestLibraries ();
if (!IsServerMode) {
foreach (var task in Tasks)
tasks.Add (task.RunAsync ());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong here, ProcessHelper.ExecuteCommandAsync does return a task, correct?

public static Task<bool> PollForExitAsync (int pid, TimeSpan timeout)

The task is ignored in BuildTestLibraries that returns void (which we should only do in events). So, I think we should be paying attention to the result of the task and, since it is async but needed, we might wait for it to success before we do anything else (there is now guaranteed AFAIK that the build will be done before we needed it).

I might be completely wrong here, but just wanted you to confirm is correct.

Expand All @@ -892,6 +893,11 @@ public bool IsServerMode {
get { return Harness.JenkinsConfiguration == "server"; }
}

void BuildTestLibraries ()
{
ProcessHelper.ExecuteCommandAsync ("make", $"all -j{Environment.ProcessorCount} -C {StringUtils.Quote (Path.Combine (Harness.RootDirectory, "test-libraries"))}", MainLog, TimeSpan.FromMinutes (1)).Wait ();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should return a Task, not void.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I call .Wait () at the end to make it synchronous.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agh, I did not see that, cool...


Task RunTestServer ()
{
var server = new HttpListener ();
Expand Down