Set transaction group interval to ZERO by default in tests
We were seeing non-deterministic behavior in randomized tests when generating backtraces took enough time to cause transactions to group in some cases, but not group in others. Tests will need to explicitly opt into grouping if they want it by setting the interval explicitly. We have tests in the text module that currently test the history grouping explicitly, but I'm not sure it's needed elsewhere.
This commit is contained in:
parent
599acf0daa
commit
273988b8d5
5 changed files with 11 additions and 14 deletions
|
@ -115,6 +115,10 @@ impl History {
|
|||
undo_stack: Vec::new(),
|
||||
redo_stack: Vec::new(),
|
||||
transaction_depth: 0,
|
||||
// Don't group transactions in tests unless we opt in, because it's a footgun.
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
group_interval: Duration::ZERO,
|
||||
#[cfg(not(any(test, feature = "test-support")))]
|
||||
group_interval: Duration::from_millis(300),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue