WIP: Add a condition method to model and view handles for use in tests

It returns a future that resolves when the provided predicate returns true. The predicate is called any time the handle's targeted entity calls notify.

Still need to add a timeout and completely remove finsih_pending_tasks.
This commit is contained in:
Nathan Sobo 2021-04-19 22:01:54 -06:00
parent 69a43afcbd
commit a4c1fe5a0b
6 changed files with 126 additions and 39 deletions

View file

@ -1,4 +1,8 @@
use crate::time::ReplicaId;
use ctor::ctor;
use log::LevelFilter;
use rand::Rng;
use simplelog::SimpleLogger;
use std::{
collections::BTreeMap,
path::{Path, PathBuf},
@ -6,7 +10,10 @@ use std::{
};
use tempdir::TempDir;
use crate::time::ReplicaId;
#[ctor]
fn init_logger() {
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
}
#[derive(Clone)]
struct Envelope<T: Clone> {