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

Integration test for CachingSession #1237

Open
wants to merge 2 commits into
base: branch-hackathon
Choose a base branch
from

Conversation

Bouncheck
Copy link

Adds the integration test caching_session::ensure_cache_is_used for CachingSession. The test sends through the scylla_proxy several queries and verifies that the number of prepare requests is exactly as expected. If the cache is working correctly no extra prepare requests should appear. If it's not, the assertions will bring attention to that.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
    No public items introduced
  • I have adjusted the documentation in ./docs/source/.
    No docs to change for the test. Docs for CachingSession are separate issue.
  • I added appropriate Fixes: annotations to PR description.
    No open issues regarding integration tests for CachingSession

@Bouncheck Bouncheck self-assigned this Feb 12, 2025
Copy link

github-actions bot commented Feb 12, 2025

cargo semver-checks found no API-breaking changes in this PR! 🎉🥳
Checked commit: 6cbd476

@Bouncheck Bouncheck force-pushed the caching-session-test branch from 570b6ab to ccb7dcc Compare February 12, 2025 16:32
@Bouncheck Bouncheck changed the title Add caching_session integration test Integration test for CachingSession Feb 12, 2025
@Bouncheck Bouncheck force-pushed the caching-session-test branch 2 times, most recently from bdcbd63 to d6f9285 Compare February 12, 2025 16:44
@wprzytula wprzytula self-requested a review February 13, 2025 09:05
Moves `SingleTargetLBP` used by `integration/tablets.rs` to `common/utils.rs`
Code is identical except added `pub(crate)` to the struct and its
`target` field.
Moving it to allow usage in `integration/caching_session.rs` from
subsequent commit and in other tests.
@Bouncheck Bouncheck force-pushed the caching-session-test branch from d6f9285 to 6950c0c Compare February 13, 2025 16:43
@Bouncheck
Copy link
Author

Pushed a new version. Let me know if should I mark conversations as resolved or if it's on the reviewer if he agrees with the new version.

@@ -300,3 +300,31 @@ impl PerformDDL for CachingSession {
self.execute_unpaged(query, &[]).await.map(|_| ())
}
}

#[derive(Debug)]
#[allow(dead_code)]
Copy link
Author

@Bouncheck Bouncheck Feb 13, 2025

Choose a reason for hiding this comment

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

I don't understand why I had to add this line here even though I use this struct in my test. Shouldn't it be not a dead_code because of that?

@Bouncheck Bouncheck requested a review from Lorak-mmk February 13, 2025 17:08
Adds the integration test `caching_session::ensure_cache_is_used`
for `CachingSession`. The test sends through the `scylla_proxy` several queries
and verifies that the number of prepare requests is exactly as expected.
If the cache is working correctly no extra prepare requests should appear.
If it's not, the assertions will bring attention to that.
@Bouncheck Bouncheck force-pushed the caching-session-test branch from 6950c0c to 6cbd476 Compare February 13, 2025 17:39
@Lorak-mmk
Copy link
Collaborator

Pushed a new version. Let me know if should I mark conversations as resolved or if it's on the reviewer if he agrees with the new version.

In this repo usually the author of the PR marks them as resolved. Is that the best way? I have no idea, maybe the reviewer should do this - we can discuss it in the future.

@muzarski muzarski self-requested a review February 16, 2025 20:26
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.

4 participants