GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [cli] Fix hanging PmdCliTest under Windows with git bash by adangel · Pull Request #7344 · pmd/pmd

Conversation

@adangel

@adangel adangel commented Nov 13, 2026

Copy link
Copy Markdown
Member

Describe the PR

PmdCliTest hangs under Windows when the build runs in git bash. In the Windows CI build it
doesn't hang forever but takes about 9.5 minutes: Time elapsed: 568.8 s -- in PmdCliTest.

The progressbar uses JLine to find out the terminal width. In git bash, PWD and MSYSTEM
are set, so JLine uses its exec terminal provider. That provider runs tty.exe with the
inherited stdin of the forked surefire JVM. Surefire reads its command channel from that
stdin at the same time, so tty.exe doesn't start until that read completes. The thread dump
shows the ProgressBar thread waiting in ExecTerminalProvider.systemStreamName /
ExecHelper.waitAndCapture.

This happened before. In d1d10d1 it was worked around by
adding --no-progress to the default arguments of PmdCliTest. The test
reportsSummaryAfterProgressBarWithReportFile (added with #6823) needs the progress bar and
doesn't use these arguments, so the problem came back.

This PR disables JLine's exec provider for all pmd-cli tests via the system property
org.jline.terminal.exec=false. The tests don't need a real terminal. Running PMD itself in
git bash isn't affected.

Related issues

  • Follow-up to d1d10d1 and [cli] Print PMD analysis summary #6823

Ready?

  • Added unit tests for fixed bug/feature (existing test reportsSummaryAfterProgressBarWithReportFile)
  • Passing all unit tests (Windows CI job: PmdCliTest should take seconds instead of ~9.5 minutes)
  • Complete build ./mvnw clean verify passes (checked by GitHub Actions)
  • Added (in-code) documentation (if needed)

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@adangel @claude
[cli] Fix hanging PmdCliTest under Windows with git bash
035fc85
The progressbar uses JLine to determine the terminal width. Under
Windows in git bash (PWD and MSYSTEM are set), JLine uses the exec
terminal provider, which runs "tty.exe" with the inherited stdin of
the forked surefire JVM. As surefire is reading from stdin (command
channel) at the same time, tty.exe doesn't start until that read
completes. This made PmdCliTest hang (locally) or take about 9.5
minutes (in the Windows CI build).

This happened before and was worked around in d1d10d1 by adding
"--no-progress" to the standard arguments of PmdCliTest. The test
reportsSummaryAfterProgressBarWithReportFile (added with pmd#6823)
needs the progress bar and doesn't use these standard arguments, so
the problem came back.

The tests don't need a real terminal, so disable the exec provider
for all pmd-cli tests instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@adangel adangel added the in:pmd-internals Affects PMD's internals label Nov 13, 2026
@adangel

adangel commented Nov 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Btw. I was testing my local branch build (https://github.com/adangel/pmd/tree/wip/real-java-modules) under Windows and noticed, that the build is hanging in pmd-cli...

I've now waited long enough, it took ~20 minutes vs. 10 seconds. How long it hangs seems to be a race between tty.exe and surefire. The timings of the last builds are 477, 518, 569, 589, 625 and 637 s for the test PmdCliTest. So, it was not always 9.5 minutes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pmd-actions-helper

pmd-actions-helper Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

No relevant source code has been changed, pmdtester skipped.

(comment created at 2026-11-13 15:45:28+00:00 for 035fc85)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adangel adangel added this to the 7.30.0 milestone Nov 13, 2026
UncleOwen
UncleOwen approved these changes Nov 13, 2026
View reviewed changes

@UncleOwen UncleOwen left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

And now it's back to 1.6s. Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@UncleOwen
UncleOwen merged commit f835461 into pmd:main Nov 13, 2026
12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@adangel

adangel commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

The build for this PR now says

[INFO] Tests run: 44, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.608 s -- in PmdCliTest

While the last build from main shows:

[INFO] Tests run: 44, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 568.8 s -- in PmdCliTest

Seems to be working, yes :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@adangel
adangel deleted the fix-windows-progressbar-hang branch November 13, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@UncleOwen UncleOwen UncleOwen approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

in:pmd-internals Affects PMD's internals

Projects

None yet

Milestone

7.30.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@adangel @UncleOwen
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.