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

Fix CI after seize update #33

Merged
merged 6 commits into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion tests/common.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
#![allow(dead_code)]

use papaya::{HashMap, HashSet, ResizeMode};
use seize::Collector;

// Run the test on different configurations of a `HashMap`.
pub fn with_map<K, V>(mut test: impl FnMut(&dyn Fn() -> HashMap<K, V>)) {
let collector = Collector::new().batch_size(128);

// Blocking resize mode.
if !cfg!(papaya_stress) {
test(&(|| HashMap::builder().resize_mode(ResizeMode::Blocking).build()));
test(
&(|| {
HashMap::builder()
.collector(collector.clone())
.resize_mode(ResizeMode::Blocking)
.build()
}),
);
}

// Incremental resize mode with a small chunk to stress operations on nested tables.
test(
&(|| {
HashMap::builder()
.collector(collector.clone())
.resize_mode(ResizeMode::Incremental(1))
.build()
}),
Expand All @@ -23,6 +34,7 @@ pub fn with_map<K, V>(mut test: impl FnMut(&dyn Fn() -> HashMap<K, V>)) {
test(
&(|| {
HashMap::builder()
.collector(collector.clone())
.resize_mode(ResizeMode::Incremental(128))
.build()
}),
Expand Down