Skip to content

[nextest-runner] with --show-progress=running, avoid output jumps up and down#2723

Merged
sunshowers merged 1 commit intomainfrom
jump
Oct 31, 2025
Merged

[nextest-runner] with --show-progress=running, avoid output jumps up and down#2723
sunshowers merged 1 commit intomainfrom
jump

Conversation

@sunshowers
Copy link
Member

Use a free list of empty bars to provide padding corresponding to the number of formerly-used rows. This means that the overall progress bar slides up rapidly, but never slides down.

@sunshowers
Copy link
Member Author

cc @glehmann would love a review from you -- this seems to fix the output sliding up and down quite nicely.

This isn't perfect but terminals were really not built for the output rapidly changing like this, unfortunately.

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

❌ Patch coverage is 1.33333% with 148 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.78%. Comparing base (36843fd) to head (efa4d57).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
nextest-runner/src/reporter/displayer/progress.rs 0.00% 148 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2723      +/-   ##
==========================================
- Coverage   77.91%   77.78%   -0.13%     
==========================================
  Files         112      112              
  Lines       25692    25731      +39     
==========================================
- Hits        20017    20016       -1     
- Misses       5675     5715      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sunshowers sunshowers force-pushed the jump branch 3 times, most recently from 75ceaa0 to 6c13edc Compare October 31, 2025 11:17
Comment on lines 770 to +771
let mut show_progress_sleep =
std::pin::pin!(crate::time::pausable_sleep(Duration::from_millis(100)));
std::pin::pin!(crate::time::pausable_sleep(Duration::from_millis(10)));
Copy link
Member Author

Choose a reason for hiding this comment

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

Also shortened this timeout -- 10ms is long enough that rapid-fire tests won't spam output, but is also less than 1 frame on 60fps.

@trunk-io
Copy link

trunk-io bot commented Oct 31, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Copy link
Contributor

@glehmann glehmann left a comment

Choose a reason for hiding this comment

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

It completely removes the moving global bar for me

if let Some(tb) = self.used_bars.get(id) {
// Reset the bar to 0.
tb.bar.set_prefix(prefix);
tb.bar.clone().with_elapsed(Duration::ZERO);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is doing something useful, unless the new bar is reassigned to tb.bar.
Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bit confusing for sure -- but ProgressBar is a lightweight Arc'd handle, and calling with_elapsed on the clone also affects the original. I'll add a comment explaining this, thanks.

Copy link
Member Author

Choose a reason for hiding this comment

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

console-rs/indicatif#742 submitted upstream to add a set_elapsed method

Copy link
Contributor

Choose a reason for hiding this comment

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

I completely missed that—thanks for the explanation!

…p and down

Use a free list of empty bars to provide padding corresponding to the number of formerly-used rows. This means that the overall progress bar slides up rapidly, but never slides down.
@sunshowers sunshowers merged commit 6e77aae into main Oct 31, 2025
23 checks passed
@sunshowers sunshowers deleted the jump branch October 31, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants