-
-
Notifications
You must be signed in to change notification settings - Fork 407
Fix broken pipe during test and gracefully exit the server #4701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
soulomoon
wants to merge
64
commits into
master
from
1875-tests-randomly-fail-with-exception-fd111-hputbuf-resource-vanished-broken-pipe---test-option-j1-workaround
Open
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
ae3a5f1
Fix broken pip during test
soulomoon cd83664
Consolidate source-repository-package entries in cabal.project
soulomoon c7ad3a2
Add flakiness testing workflow
soulomoon 4d56b39
Update flakiness workflow and fix exit codes in open-close loop script
soulomoon 9272de3
Update lsp repository tag in cabal.project
soulomoon e1a7947
Update flakiness.yml
soulomoon ed85d9b
Add InitParameters data type and enhance shutdown handling in Languag...
soulomoon 100b39e
Rename InitParameters to InitializationContext and update related fie...
soulomoon 5835ad7
Increase default maximum iterations to 1000 in flakiness workflow
soulomoon d26ed7f
Update cabal.project and LanguageServer for improved logging and upda...
soulomoon c0f6a9b
Merge branch 'master' into 1875-tests-randomly-fail-with-exception-fd...
soulomoon 1f9cb02
Update lsp repository tag to latest commit
soulomoon c72d2e7
Improve log message for server exit and simplify test failure detecti...
soulomoon 569d766
Fix flakiness test
soulomoon cb67ec5
Set default max_iter value to 1000 in flakiness test workflow
soulomoon 56bc03b
Refactor logging in open-close loop script to improve iteration outpu...
soulomoon 9f24f2e
Fix exit codes for broken pipe and test failure detection in open-clo...
soulomoon 8eb7bb5
Refactor flakiness testing workflow: replace open-close loop script w...
soulomoon d233023
Update lsp repository tag to a447a4f
soulomoon fe7421e
Update cabal.project
soulomoon 7bf694a
update CI
soulomoon 8c17daa
Update reactor shutdown logging, and improve shutdown handling
soulomoon 6907be0
update flaky-test-loop script
soulomoon 0851914
update lsp rev
soulomoon 7900d71
Use a TMVar as a stop flag to coordinate graceful shutdown.
soulomoon 8c50e74
restore
soulomoon 54e334b
restore
soulomoon d1b6d55
update CI
soulomoon 53a6162
update test
soulomoon a26922c
Remove comment markers from flaky test patterns for clarity
soulomoon d10cf47
Remove pattern_file input and use default pattern file for flakiness ...
soulomoon b36f8a6
Replace writeFile and writeFileUTF8 with atomicFileWriteString and at...
soulomoon 15cd44a
Refactor flaky test loop script for improved build handling and error...
soulomoon ed1c20c
Update lsp
soulomoon 53c4536
format
soulomoon a9fa00d
Enhance testing workflow and progress reporting
soulomoon 6e50414
Simplify build step in flakiness workflow to compile all tests
soulomoon 1097ce6
Add HLS test executables to flakiness workflow environment
soulomoon afb4328
Update flakiness workflow to dynamically locate HLS executable
soulomoon 5384ea7
Refactor flakiness workflow to streamline HLS test execution command
soulomoon bffdb6a
Replace waitForAllProgressDone with waitForKickDone in resolveRequest...
soulomoon d07c06f
always send progress
soulomoon 7ad628e
update lsp
soulomoon b962e1f
increase timeout for flakiness
soulomoon c3758fa
update number of runs to 500 for flakiness
soulomoon b313fd0
update CI
soulomoon 84f7d35
Add AsyncParentKill exception handling and improve database step retr...
soulomoon 9788101
fix bench
soulomoon a87d1c2
fix import
soulomoon 66dc235
fix compilation
soulomoon 8483c7b
add event log
soulomoon 969bce9
workaround hlint bug
soulomoon 8f37e25
enforce build state changes
soulomoon 08350aa
Merge remote-tracking branch 'upstream/master' into 1875-tests-random...
soulomoon 773bfee
new hls-graph runtime
soulomoon b771ed2
update script
soulomoon f0ae0ee
Merge remote-tracking branch 'upstream/master' into 1875-tests-random...
soulomoon 08e7a8a
Revert "new hls-graph runtime"
soulomoon 075b742
revert hls-graph changes
soulomoon 767ca29
fix build
soulomoon 73ce412
revert test CI changes
soulomoon 42bbfbe
Refactor flakiness workflow and CI
soulomoon 81c46b6
clean up and revert other flakiness test changes
soulomoon 405ea59
cleanup
soulomoon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,109 @@ | ||
name: flakiness | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
concurrency: | ||
group: ${{ github.head_ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
# Run on PRs that touch relevant areas and on manual dispatch | ||
pull_request: | ||
branches: | ||
- '**' | ||
paths: | ||
- 'scripts/flaky-test-loop.sh' | ||
- 'scripts/flaky-test-patterns.txt' | ||
- 'ghcide/**' | ||
- 'ghcide-test/**' | ||
- 'hls-test-utils/**' | ||
- 'src/**' | ||
- 'exe/**' | ||
- 'plugins/**' | ||
- 'cabal.project' | ||
- 'stack.yaml' | ||
- 'haskell-language-server.cabal' | ||
- '.github/workflows/flakiness.yml' | ||
workflow_dispatch: | ||
inputs: | ||
max_iter: | ||
description: 'Maximum iterations to attempt' | ||
required: false | ||
default: '1000' | ||
sleep_secs: | ||
description: 'Seconds to sleep between iterations' | ||
required: false | ||
default: '0' | ||
test_patterns: | ||
description: 'Comma-separated Tasty patterns to run each iteration (overrides default)' | ||
required: false | ||
default: '' | ||
|
||
jobs: | ||
loop: | ||
name: Flakiness Test (broken pipe and test failures) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
# - windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup GHC and caching | ||
uses: ./.github/actions/setup-build | ||
with: | ||
ghc: '9.12' | ||
os: ${{ runner.os }} | ||
|
||
- name: Show cabal and GHC versions | ||
run: | | ||
cabal --version | ||
ghc --version | ||
- name: Build | ||
env: | ||
PATTERN_FILE: 'scripts/flaky-test-patterns.txt' | ||
RUN_MODE: 'build' | ||
run: HLS_TEST_EXE="$(cabal exec which hls)" bash scripts/flaky-test-loop.sh | ||
|
||
- name: Run flakiness loop | ||
id: run-loop | ||
# Let this run for a while; build is done once inside the script | ||
timeout-minutes: 60 | ||
env: | ||
# Use workflow_dispatch inputs when present, else defaults | ||
SLEEP_SECS: ${{ github.event.inputs.sleep_secs || '0' }} | ||
LOG_STDERR: '1' | ||
TEST_PATTERNS: ${{ github.event.inputs.test_patterns }} | ||
PATTERN_FILE: 'scripts/flaky-test-patterns.txt' | ||
NO_BUILD_ONCE: '1' | ||
RUN_MODE: 'run' | ||
# HLS_TEST_EXE: 'hls' # HLS_WRAPPER_TEST_EXE: 'hls-wrapper' | ||
run: | | ||
# Run with a sensible default of 500 iterations on PRs; | ||
max_iter="${{ github.event.inputs.max_iter }}" | ||
max_iter="${max_iter:-500}" | ||
# copy hls to current dir so the script can find it | ||
HLS_TEST_EXE="$(cabal exec which hls)" bash scripts/flaky-test-loop.sh "${max_iter}" | ||
ec=$? | ||
# Interpret exit codes from flaky-test-loop.sh | ||
# 0 => no issues reproduced within MAX_ITER -> pass job | ||
# 1 => issue reproduced (broken pipe or test failure) -> fail job | ||
# 2+ => setup/infra error -> fail job | ||
if [[ $ec -eq 1 ]]; then | ||
echo "Issue reproduced (broken pipe or test failure): failing job" | ||
exit 1 | ||
elif [[ $ec -eq 0 ]]; then | ||
echo "No issues reproduced within MAX_ITER=${max_iter}: passing" | ||
exit 0 | ||
else | ||
echo "Loop script error (exit $ec): failing" | ||
exit $ec | ||
fi | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.