mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-03 16:34:19 +01:00
adjust shrinking as we do not have a property pointer
This commit is contained in:
@@ -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,
|
||||
_ => {
|
||||
|
||||
Reference in New Issue
Block a user