From ff51965c3ea119395fc9ec200dedc5c15fa9bf32 Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Wed, 20 Aug 2025 14:34:37 -0300 Subject: [PATCH] fix shrinking to not include some properties that are present in faulty query, but that are not relevant to the error --- simulator/shrink/plan.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/simulator/shrink/plan.rs b/simulator/shrink/plan.rs index 7def800ce..43e2912fb 100644 --- a/simulator/shrink/plan.rs +++ b/simulator/shrink/plan.rs @@ -56,6 +56,12 @@ impl InteractionPlan { // Remove all properties that do not use the failing tables plan.plan.retain_mut(|interactions| { let retain = if idx == failing_execution.interaction_index { + if let Interactions::Property( + Property::FsyncNoWait { tables, .. } | Property::FaultyQuery { tables, .. }, + ) = interactions + { + tables.retain(|table| depending_tables.contains(table)); + } true } else { let mut has_table = interactions @@ -73,9 +79,13 @@ impl InteractionPlan { | Property::DropSelect { queries, .. } => { queries.clear(); } - Property::FsyncNoWait { tables, .. } - | Property::FaultyQuery { tables, .. } => { - tables.retain(|table| depending_tables.contains(table)); + Property::FsyncNoWait { tables, query } + | Property::FaultyQuery { tables, query } => { + if !query.uses().iter().any(|t| depending_tables.contains(t)) { + tables.clear(); + } else { + tables.retain(|table| depending_tables.contains(table)); + } } Property::SelectLimit { .. } | Property::SelectSelectOptimizer { .. }