adjust shrinking as we do not have a property pointer

This commit is contained in:
pedrocarlo
2025-09-16 15:56:47 -03:00
parent b98c22a90e
commit 35ddcb4270

View File

@@ -1,3 +1,5 @@
use indexmap::IndexSet;
use crate::{
SandboxedResult, SimulatorEnv,
generation::{
@@ -17,15 +19,15 @@ impl InteractionPlan {
// - Shrink to multiple values by removing random interactions
// - Shrink properties by removing their extensions, or shrinking their values
let mut plan = self.clone();
let failing_property = &self.plan[failing_execution.interaction_index];
let mut depending_tables = failing_property.dependencies();
// let failing_property = &self.plan[failing_execution.interaction_index];
let mut depending_tables = IndexSet::new();
let interactions = failing_property.interactions();
let all_interactions = self.interactions_list().collect::<Vec<_>>();
{
let mut idx = failing_execution.secondary_index;
let mut idx = failing_execution.interaction_index;
loop {
match &interactions[idx].interaction {
match &all_interactions[idx].interaction {
InteractionType::Query(query) => {
depending_tables = query.dependencies();
break;
@@ -47,6 +49,9 @@ impl InteractionPlan {
}
}
// assert we always depend on some table for now
assert!(!depending_tables.is_empty());
let before = self.plan.len();
// Remove all properties after the failing one
@@ -149,14 +154,12 @@ impl InteractionPlan {
};
let mut plan = self.clone();
let failing_property = &self.plan[failing_execution.interaction_index];
let interactions = failing_property.interactions();
let all_interactions = self.interactions_list().collect::<Vec<_>>();
{
let mut idx = failing_execution.secondary_index;
let mut idx = failing_execution.interaction_index;
loop {
match &interactions[idx].interaction {
match &all_interactions[idx].interaction {
// Fault does not depend on
InteractionType::Fault(..) => break,
_ => {