Skip to content
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

[testing] serial testing preserving terminal #791

Merged
merged 1 commit into from
Aug 5, 2023

Conversation

nthparameter
Copy link
Contributor

This change does two things:

  • add the serial_test crate to run selected tests serial rather than in parallel. This is done because they use global state so running them in parallel leads to race conditions and flaky results (sometimes they pass, sometimes they fail). Running them serialy avoids this flakiness.
  • create a screen buffer within the test. This avoids changing the terminal (screen buffer) which is running the test. for example, a test that changes the terminal size to 20 x 20 can leave the developer running the test with a resized terminal. Creating a separate screen buffer for the test avoids this.

This change does two things:
- add the serial_test crate to run selected tests serial rather
  than in parallel. This is done because they use global state
  so running them in parallel leads to race conditions and flaky
  results (sometimes they pass, sometimes they fail). Running
  them serialy avoids this flakiness.
- create a screen buffer within the test. This avoids changing
  the terminal (screen buffer) which is running the test. for
  example, a test that changes the terminal size to 20 x 20 can
  leave the developer running the test with a resized terminal.
  Creating a separate screen buffer for the test avoids this.
@nthparameter nthparameter requested a review from TimonPost as a code owner June 20, 2023 21:15
@TimonPost TimonPost merged commit 00f7d06 into crossterm-rs:master Aug 5, 2023
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