Skip to content

Commit dc37285

Browse files
konardclaude
andcommitted
Fix Transaction benchmark isolation with proper cleanup
The Transaction benchmark implementation was missing proper cleanup in fork() and unfork() methods, unlike the Client implementation which properly cleaned state between iterations. This caused state pollution between benchmarks: - Delete/Neo4j_Transaction couldn't find links created by previous benchmark iterations - Panic: 'NotExists(4000)' at delete.rs:23 Solution: Add drop_table() calls in Transaction's fork() and unfork() methods to ensure each benchmark iteration starts with a clean state, matching the Client implementation's behavior. Fixes part of #5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 1b69253 commit dc37285

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rust/src/benched.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,13 @@ impl<'a, T: LinkType> Benched for Exclusive<Transaction<'a, T>> {
100100
}
101101

102102
fn fork(&mut self) -> Fork<Self> {
103+
// Clean up any existing data before benchmark to ensure isolation
104+
let _ = self.drop_table();
103105
Fork(self)
104106
}
105107

106108
unsafe fn unfork(&mut self) {
107-
// Transaction cleanup handled by client
109+
// Clean up after benchmark iteration
110+
let _ = self.drop_table();
108111
}
109112
}

0 commit comments

Comments
 (0)