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

Replace sleep calls in tests with a direct cache refresh function #1648

Merged
merged 4 commits into from
Jul 27, 2023

Conversation

inahga
Copy link
Contributor

@inahga inahga commented Jul 26, 2023

Follow up to #1640 (comment).

@inahga inahga requested a review from a team as a code owner July 26, 2023 21:41
aggregator/src/cache.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@divergentdave divergentdave left a comment

Choose a reason for hiding this comment

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

Unrelated: could we rename create_report_with_id() to create_report_with_key()? There are enough IDs in a report that I think its current name is unclear.

@@ -125,9 +128,25 @@ impl GlobalHpkeKeypairCache {
let keypairs = self.keypairs.lock().unwrap();
keypairs.get(id).cloned()
}

#[cfg(feature = "test-util")]
pub async fn refresh(&self) -> Result<(), Error> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should extract the common body of this and the async block in new() to a new private method.

@inahga
Copy link
Contributor Author

inahga commented Jul 27, 2023

#1649 for renaming function.

Make rustdoc happy

Errant file change

Cleanups
aggregator/src/cache.rs Outdated Show resolved Hide resolved
aggregator/src/cache.rs Outdated Show resolved Hide resolved
Co-authored-by: David Cook <dcook@divviup.org>
@inahga inahga enabled auto-merge (squash) July 27, 2023 18:32
@inahga inahga merged commit b4c396f into main Jul 27, 2023
7 checks passed
@inahga inahga deleted the inahga/no-sleep-in-tests branch July 27, 2023 19:48
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.

None yet

2 participants