Skip to content

Commit

Permalink
fix CI timeout after seize update
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev authored Nov 27, 2024
1 parent a85fec2 commit 02afd52
Showing 1 changed file with 13 additions and 1 deletion.
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

0 comments on commit 02afd52

Please sign in to comment.