-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Time-constrain user commands in XHarness workloads (#7936)
We have to make sure that user commands are time-constrained so that we have buffer to call clean-up and send the telemetry at the end of the job. We do this by bumping the original work item timeout and setting a timeout for the injected user commands.
- Loading branch information
Showing
11 changed files
with
121 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/Microsoft.DotNet.Helix/Sdk/tools/xharness-runner/xharness-helix-job.android.header.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<# | ||
This script is used as a payload of Helix jobs that execute Android workloads through XHarness on Windows systems. | ||
This file is a header of script that gets populated with user's custom commands. | ||
This script is separate as it is executed with a timeout in its own process. | ||
#> | ||
|
||
param ( | ||
[Parameter(Mandatory)] | ||
[string]$output_directory, | ||
[Parameter(Mandatory)] | ||
[string]$app, | ||
[Parameter(Mandatory)] | ||
[string]$timeout, | ||
[Parameter()] | ||
[string]$package_name = $null, | ||
[Parameter()] | ||
[int]$expected_exit_code = 0, | ||
[Parameter()] | ||
[string]$device_output_path = $null, | ||
[Parameter()] | ||
[string]$instrumentation = $null | ||
) | ||
|
||
$ErrorActionPreference="Continue" | ||
|
||
# The xharness alias | ||
function xharness() { | ||
dotnet exec $Env:XHARNESS_CLI_PATH @args | ||
} | ||
|
||
# User can call this when they detect a problem they think is caused by the infrastructure | ||
function report_infrastructure_failure($message) { | ||
Write-Output "Infrastructural problem reported by the user, requesting retry+reboot: $message" | ||
|
||
& "$Env:HELIX_PYTHONPATH" -c "from helix.workitemutil import request_infra_retry; request_infra_retry('Retrying because we could not enumerate all Android devices')" | ||
& "$Env:HELIX_PYTHONPATH" -c "from helix.workitemutil import request_reboot; request_reboot('Rebooting to allow Android emulator or device to restart')" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters