-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hack to work around microsoft/vscode#178241
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This script is run by GitHub Actions on Windows | ||
# We need this script to work around a bug in the Windows GitHub Actions | ||
# environment where VSCode sometimes becomes unresponsive during the tests. | ||
# See https://github.com/microsoft/vscode/issues/178241 | ||
set -euo pipefail | ||
|
||
test_output_path="test-output.txt" | ||
|
||
ret=0 | ||
script --flush --quiet --return "$test_output_path" --command "pnpm --color test" || ret=$? | ||
|
||
# If the test failed, but contains the string "CodeWindow: detected unresponsive", | ||
# then it is https://github.com/microsoft/vscode/issues/178241; try 2 more times | ||
|
||
for i in {1..2}; do | ||
if [[ $ret -ne 0 ]]; then | ||
if grep -q "CodeWindow: detected unresponsive" "$test_output_path"; then | ||
echo "Detected unresponsive VSCode window; retrying" | ||
script --flush --quiet --return "$test_output_path" --command "pnpm --color test" || ret=$? | ||
else | ||
break | ||
fi | ||
fi | ||
done | ||
|
||
if [[ $ret -ne 0 ]]; then | ||
echo "Test failed" | ||
exit $ret | ||
fi |