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

Improve the tests to the Views. #3166

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

MathieuDutSik
Copy link
Contributor

Motivation

Recently, a long-standing bug was found in the RegisterView.

Proposal

Some implementing of TestView were done for SetView / QueueView.

The test that detects the found problem for the RegisterView was extended to all the view supporting TestView.

Test Plan

Simply improve the tests.

Release Plan

Nothing relevant.

Links

None

@MathieuDutSik MathieuDutSik requested a review from jvff January 23, 2025 08:31
@MathieuDutSik MathieuDutSik marked this pull request as ready for review January 23, 2025 08:31
Copy link
Contributor

@jvff jvff left a comment

Choose a reason for hiding this comment

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

Looks good! I left an optional suggestion, but we can also merge it like this.

type State = HashSet<i32>;

async fn stage_initial_changes(&mut self) -> Result<Self::State, ViewError> {
let dummy_values = [0, -1, 2, -3, 4, -5];
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional: we could create a const INITIAL_SET_VIEW_CHANGES: &[i32] = [...]; outside the impl TestView to make it easier to change it if needed in the future.

The same could also be done for other views if needed.

@MathieuDutSik MathieuDutSik merged commit a918bc9 into linera-io:main Jan 27, 2025
23 checks passed
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