Skip to content

Conversation

@glehmann
Copy link
Contributor

@glehmann glehmann commented Nov 1, 2025

ref #2720

With fast running tests, it avoids showing a partially filled list of
tests that can lead the user to think not all the possible tests are
running in parallel.
@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

❌ Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.39%. Comparing base (eec0ebe) to head (5944924).

Files with missing lines Patch % Lines
nextest-runner/src/reporter/displayer/progress.rs 0.00% 35 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2729      +/-   ##
==========================================
+ Coverage   77.37%   77.39%   +0.02%     
==========================================
  Files         112      112              
  Lines       25893    25886       -7     
==========================================
  Hits        20034    20034              
+ Misses       5859     5852       -7     

☔ 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.

let multi_progress = MultiProgress::new();
multi_progress.set_draw_target(Self::stderr_target());
multi_progress.set_move_cursor(true);
// multi_progress.set_move_cursor(true);
Copy link
Member

Choose a reason for hiding this comment

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

In my testing I found that set_move_cursor(true) made things a bit better -- did it make things worse for you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enabling set_move_cursor(true) causes a visual bug where the end of a longer, previously drawn line isn't cleared when a shorter line overwrites it.
It was not visible before because of the total redraw when calling suspend()


/// The refresh rate for the progress bar, set to half the tick interval in hz.
pub const PROGRESS_REFRESH_RATE_HZ: u8 = 10;
pub const PROGRESS_REFRESH_RATE_HZ: u8 = 20;
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I feel like this might be too fast especially over a slower connection like sshing into a remote.

I think setting both to be the same might cause weird issues where both are slightly out of sync with each other. In any case the comment here needs to be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've reduced the refresh rate to 10 Hz. I'm still experimenting with the tick interval.

Comment on lines -597 to -601
TestEventKind::TestShowProgress {
test_instance,
running,
..
} => {
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, again worried about this overwhelming the display with fast test suites like clap over a slower connection.

Comment on lines 741 to 729
// suspend forces a full redraw, so we call it only if there is
// something in the buffer
if !buf.is_empty() {
self.multi_progress
.suspend(|| std::io::stderr().write_all(buf))
} else {
Ok(())
}
Copy link
Member

Choose a reason for hiding this comment

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

This seems like a good change.

@sunshowers
Copy link
Member

Something I noticed while testing this out is that we'd show "n-1 tests running" (e.g. 7 tests running or 31 tests running) a lot more than we do on main.

@glehmann
Copy link
Contributor Author

glehmann commented Nov 1, 2025

Something I noticed while testing this out is that we'd show "n-1 tests running" (e.g. 7 tests running or 31 tests running) a lot more than we do on main.

Yes, I've noticed that too. I wonder if this is because of the blank line we're adding that may prevent the test from appearing. I'm preparing a change that adds the blank lines only before using suspend() to prevent the bar movement.

@sunshowers
Copy link
Member

I think we may need to improve our event model a bit — currently, when a test completes and the next test is started we send two separate events. I think we may need to coalesce them down into one event so that the number of running tests stays the same. (I learned this lesson in another event protocol I built later.)

@glehmann glehmann force-pushed the gln/reduce-flicker-smooth-display-llsm branch from 4ff7914 to 5944924 Compare November 1, 2025 22:12
@glehmann
Copy link
Contributor Author

glehmann commented Nov 1, 2025

I think we may need to improve our event model a bit — currently, when a test completes and the next test is started we send two separate events. I think we may need to coalesce them down into one event so that the number of running tests stays the same. (I learned this lesson in another event protocol I built later.)

Yes, it should help!

@glehmann
Copy link
Contributor Author

glehmann commented Nov 1, 2025

Creating a bar with spaces only when writing a message to the user with write_buf significantly reduced the flickering of the last line with --show-progress=only, but didn't remove it totally.

@sunshowers
Copy link
Member

sunshowers commented Nov 1, 2025

Creating a bar with spaces only when writing a message to the user with write_buf significantly reduced the flickering of the last line with --show-progress=only, but didn't remove it totally.

Fascinating, is that because the added bar is the very last one and there's some weird logic in indicatif around the last bar?

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