mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
Replace DeterministicExecutor::reset with forbid_parking
There's really no point calling reset if we plan on parking afterwards. Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
64927abbc4
commit
ee213696aa
2 changed files with 3 additions and 14 deletions
|
@ -328,23 +328,14 @@ impl Foreground {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn reset(&self) {
|
||||
match self {
|
||||
Self::Platform { .. } => panic!("can't call this method on a platform executor"),
|
||||
Self::Test(_) => panic!("can't call this method on a test executor"),
|
||||
Self::Deterministic(executor) => {
|
||||
let state = &mut *executor.state.lock();
|
||||
state.rng = StdRng::seed_from_u64(state.seed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn forbid_parking(&self) {
|
||||
match self {
|
||||
Self::Platform { .. } => panic!("can't call this method on a platform executor"),
|
||||
Self::Test(_) => panic!("can't call this method on a test executor"),
|
||||
Self::Deterministic(executor) => {
|
||||
executor.state.lock().forbid_parking = true;
|
||||
let mut state = executor.state.lock();
|
||||
state.forbid_parking = true;
|
||||
state.rng = StdRng::seed_from_u64(state.seed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -523,8 +523,6 @@ impl TestServer {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
// Reset the executor because running SQL queries has a non-deterministic impact on it.
|
||||
cx.foreground().reset();
|
||||
client
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue