From b28fd237a4aaa5aca100e9bab1313735fa21ec07 Mon Sep 17 00:00:00 2001 From: Devin Jean Date: Wed, 1 Nov 2023 23:47:49 -0500 Subject: [PATCH] time refactor --- src/cli.rs | 9 ++- src/process.rs | 10 +-- src/runtime.rs | 12 +++- src/std_system.rs | 94 ++++++++++++++++++++++++-- src/test/process.rs | 157 ++++++++++++++++++++++---------------------- src/test/project.rs | 39 +++++------ 6 files changed, 207 insertions(+), 114 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 8039cee..9abd23d 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -215,7 +215,8 @@ fn run_proj_tty>>(project_name: &str, server: String }, }); - let system = Rc::new(StdSystem::new_sync(server, Some(project_name), config, utc_offset)); + let clock = Arc::new(FineClock::new(utc_offset)); + let system = Rc::new(StdSystem::new_sync(server, Some(project_name), config, clock)); let mut idle_sleeper = IdleAction::new(YIELDS_BEFORE_IDLE_SLEEP, Box::new(|| thread::sleep(IDLE_SLEEP_TIME))); print!("public id: {}\r\n", system.get_public_id()); @@ -307,7 +308,8 @@ fn run_proj_non_tty>>(project_name: &str, server: St })), }); - let system = Rc::new(StdSystem::new_sync(server, Some(project_name), config, utc_offset)); + let clock = Arc::new(FineClock::new(utc_offset)); + let system = Rc::new(StdSystem::new_sync(server, Some(project_name), config, clock)); let mut idle_sleeper = IdleAction::new(YIELDS_BEFORE_IDLE_SLEEP, Box::new(|| thread::sleep(IDLE_SLEEP_TIME))); println!(">>> public id: {}\n", system.get_public_id()); @@ -391,7 +393,8 @@ fn run_server>>(nb_server: String, addr: String, por _ => CommandStatus::UseDefault { key, command }, })), }); - let system = Rc::new(StdSystem::new_sync(nb_server, Some("native-server"), config, utc_offset)); + let clock = Arc::new(FineClock::new(utc_offset)); + let system = Rc::new(StdSystem::new_sync(nb_server, Some("native-server"), config, clock)); let mut idle_sleeper = IdleAction::new(YIELDS_BEFORE_IDLE_SLEEP, Box::new(|| thread::sleep(IDLE_SLEEP_TIME))); println!("public id: {}", system.get_public_id()); diff --git a/src/process.rs b/src/process.rs index 0fec105..fe167c5 100644 --- a/src/process.rs +++ b/src/process.rs @@ -398,7 +398,7 @@ impl<'gc, C: CustomTypes, S: System> Process<'gc, C, S> { } false => return Ok(ProcessStep::Yield), } - Some(Defer::Sleep { until, aft_pos }) => match global_context.system.time().to_arbitrary_ms()? >= *until { + Some(Defer::Sleep { until, aft_pos }) => match global_context.system.time(TimePrecision::Recent).to_arbitrary_ms()? >= *until { true => { self.pos = *aft_pos; self.defer = None; @@ -1095,11 +1095,11 @@ impl<'gc, C: CustomTypes, S: System> Process<'gc, C, S> { self.pos = aft_pos; } Instruction::ResetTimer => { - global_context.timer_start = global_context.system.time().to_arbitrary_ms()?; + global_context.timer_start = global_context.system.time(TimePrecision::Now).to_arbitrary_ms()?; self.pos = aft_pos; } Instruction::PushTimer => { - self.value_stack.push(Number::new(global_context.system.time().to_arbitrary_ms()?.saturating_sub(global_context.timer_start) as f64 / 1000.0)?.into()); + self.value_stack.push(Number::new(global_context.system.time(TimePrecision::Now).to_arbitrary_ms()?.saturating_sub(global_context.timer_start) as f64 / 1000.0)?.into()); self.pos = aft_pos; } Instruction::Sleep => { @@ -1108,10 +1108,10 @@ impl<'gc, C: CustomTypes, S: System> Process<'gc, C, S> { self.pos = aft_pos; return Ok(ProcessStep::Yield); } - self.defer = Some(Defer::Sleep { until: global_context.system.time().to_arbitrary_ms()? + ms as u64, aft_pos }); + self.defer = Some(Defer::Sleep { until: global_context.system.time(TimePrecision::Now).to_arbitrary_ms()? + ms as u64, aft_pos }); } Instruction::PushRealTime { query } => { - let t = global_context.system.time().to_real_local()?; + let t = global_context.system.time(TimePrecision::Now).to_real_local()?; let v = match query { TimeQuery::UnixTimestampMs => (t.unix_timestamp_nanos() / 1000000) as f64, TimeQuery::Year => t.year() as f64, diff --git a/src/runtime.rs b/src/runtime.rs index 8b2cf32..15f2608 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -1434,7 +1434,7 @@ impl<'gc, C: CustomTypes, S: System> GlobalContext<'gc, C, S> { } let proj_name = init_info.proj_name.clone(); - let timer_start = system.time().to_arbitrary_ms::().unwrap_or(0); + let timer_start = system.time(TimePrecision::Now).to_arbitrary_ms::().unwrap_or(0); Self { proj_name, globals, entities, timer_start, system, settings, bytecode } } @@ -1773,6 +1773,14 @@ impl SysTime { } } +/// The required precision of a current time measurement. +pub enum TimePrecision { + /// The real current time. + Now, + /// The real current time or a (recent) cached timestamp. + Recent, +} + /// Represents all the features of an implementing system. /// /// This type encodes any features that cannot be performed without platform-specific resources. @@ -1797,7 +1805,7 @@ pub trait System>: 'static + Sized { fn rand>(&self, range: R) -> T; /// Gets the current system time. - fn time(&self) -> SysTime; + fn time(&self, precision: TimePrecision) -> SysTime; /// Performs a general request which returns a value to the system. /// Ideally, this function should be non-blocking, and the requestor will await the result asynchronously. diff --git a/src/std_system.rs b/src/std_system.rs index 7ceb17c..3457cef 100644 --- a/src/std_system.rs +++ b/src/std_system.rs @@ -97,6 +97,82 @@ impl Key> for CommandKey { } } +/// An abstract wall-time clock with optional coarse granularity. +pub trait Clock { + /// Read the real current time. + fn now(&self) -> OffsetDateTime; + /// Read a recent cached time. + fn recent(&self) -> OffsetDateTime; +} + +/// A [`Clock`] that has fine granularity. +/// +/// This type implements [`Clock::recent`] by calling [`Clock::now`] (no caching). +/// This can be inefficient if called many times in rapid succession, in which case [`CoarseClock`] could be used. +pub struct FineClock(UtcOffset); +impl FineClock { + pub fn new(utc_offset: UtcOffset) -> Self { + Self(utc_offset) + } +} +impl Clock for FineClock { + fn now(&self) -> OffsetDateTime { + OffsetDateTime::now_utc().to_offset(self.0) + } + fn recent(&self) -> OffsetDateTime { + self.now() + } +} + +/// A [`Clock`] that has coarse granularity. +/// +/// This type implements [`Clock::recent`] by quickly fetching the most recent cached result of [`Clock::now`]. +/// [`StdSystem`] will automatically call [`Clock::now`] for some operations that require precise timing; +/// however, it is your responsibility to (externally) periodically call [`Clock::now`] for use with fuzzy timing logic like sleep operations. +pub struct CoarseClock(Mutex, FineClock); +impl CoarseClock { + pub fn new(utc_offset: UtcOffset) -> Self { + let c = FineClock::new(utc_offset); + Self(Mutex::new(c.now()), c) + } +} +impl Clock for CoarseClock { + fn now(&self) -> OffsetDateTime { + let t = self.1.now(); + *self.0.lock().unwrap() = t; + t + } + fn recent(&self) -> OffsetDateTime { + *self.0.lock().unwrap() + } +} + +#[test] +fn test_clocks() { + fn test_at(utc_offset: UtcOffset) { + let a = FineClock::new(utc_offset); + let b = CoarseClock::new(utc_offset); + + fn check_eq(a: OffsetDateTime, b: OffsetDateTime) { + assert_eq!(a.offset(), b.offset()); + assert!((a - b).abs().whole_microseconds() <= 1000); + assert_eq!(a.hour(), b.hour()); + assert_eq!(a.minute(), b.minute()); + } + check_eq(a.recent(), b.recent()); + b.now(); + check_eq(a.recent(), b.recent()); + } + test_at(UtcOffset::UTC); + test_at(UtcOffset::from_hms(0, 0, 0).unwrap()); + test_at(UtcOffset::from_hms(0, 0, 50).unwrap()); + test_at(UtcOffset::from_hms(-19, 0, 50).unwrap()); + test_at(UtcOffset::from_hms(-19, 30, 50).unwrap()); + test_at(UtcOffset::from_hms(2, 30, 50).unwrap()); + test_at(UtcOffset::from_hms(2, -10, 50).unwrap()); + test_at(UtcOffset::from_hms(2, -10, -12).unwrap()); +} + type MessageReplies = BTreeMap; async fn call_rpc_async>>(context: &Context, client: &reqwest::Client, service: &str, rpc: &str, args: &[(&str, &Json)]) -> Result { @@ -141,7 +217,7 @@ pub struct StdSystem>> { context: Arc, client: Arc, rng: Mutex, - utc_offset: UtcOffset, + clock: Arc, rpc_request_pipe: Sender>, @@ -154,11 +230,11 @@ impl>> StdSystem { /// Equivalent to [`StdSystem::new_async`] except that it can be executed outside of async context. /// Note that using this from within async context will result in a panic from `tokio` trying to create a runtime within a runtime. #[tokio::main(flavor = "current_thread")] - pub async fn new_sync(base_url: String, project_name: Option<&str>, config: Config, utc_offset: UtcOffset) -> Self { - Self::new_async(base_url, project_name, config, utc_offset).await + pub async fn new_sync(base_url: String, project_name: Option<&str>, config: Config, clock: Arc) -> Self { + Self::new_async(base_url, project_name, config, clock).await } /// Initializes a new instance of [`StdSystem`] targeting the given NetsBlox server base url (e.g., `https://cloud.netsblox.org`). - pub async fn new_async(base_url: String, project_name: Option<&str>, config: Config, utc_offset: UtcOffset) -> Self { + pub async fn new_async(base_url: String, project_name: Option<&str>, config: Config, clock: Arc) -> Self { let configuration = reqwest::get(format!("{base_url}/configuration")).await.unwrap().json::>().await.unwrap(); let services_hosts = configuration["servicesHosts"].as_array().unwrap(); @@ -341,7 +417,7 @@ impl>> StdSystem { }); Self { - config, context, client, utc_offset, + config, context, client, clock, rng: Mutex::new(ChaChaRng::from_seed(seed)), rpc_request_pipe, message_replies, message_sender, message_receiver, message_injector, @@ -375,8 +451,12 @@ impl>> System for StdSystem { self.rng.lock().unwrap().gen_range(range) } - fn time(&self) -> SysTime { - SysTime::Real { local: OffsetDateTime::now_utc().to_offset(self.utc_offset) } + fn time(&self, precision: TimePrecision) -> SysTime { + let local = match precision { + TimePrecision::Now => self.clock.now(), + TimePrecision::Recent => self.clock.recent(), + }; + SysTime::Real { local } } fn perform_request<'gc>(&self, mc: &Mutation<'gc>, request: Request<'gc, C, Self>, entity: &mut Entity<'gc, C, Self>) -> Result> { diff --git a/src/test/process.rs b/src/test/process.rs index 203a08a..b98db6c 100644 --- a/src/test/process.rs +++ b/src/test/process.rs @@ -2,6 +2,7 @@ use alloc::rc::Rc; use alloc::borrow::ToOwned; use alloc::collections::BTreeMap; use alloc::string::{String, ToString}; +use alloc::sync::Arc; use core::cell::RefCell; use core::fmt::Write; @@ -79,7 +80,7 @@ fn run_till_term(env: &mut EnvArena, and_then: F) where F: for<'gc> FnOnce(&M #[test] fn test_proc_ret() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -95,7 +96,7 @@ fn test_proc_ret() { #[test] fn test_proc_sum_123n() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -118,7 +119,7 @@ fn test_proc_sum_123n() { #[test] fn test_proc_recursive_factorial() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -141,7 +142,7 @@ fn test_proc_recursive_factorial() { #[test] fn test_proc_loops_lists_basic() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -181,7 +182,7 @@ fn test_proc_loops_lists_basic() { #[test] fn test_proc_recursively_self_containing_lists() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -226,7 +227,7 @@ fn test_proc_recursively_self_containing_lists() { #[test] fn test_proc_sieve_of_eratosthenes() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -252,7 +253,7 @@ fn test_proc_sieve_of_eratosthenes() { #[test] fn test_proc_early_return() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -268,7 +269,7 @@ fn test_proc_early_return() { #[test] fn test_proc_short_circuit() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -296,7 +297,7 @@ fn test_proc_short_circuit() { #[test] fn test_proc_all_arithmetic() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -340,7 +341,7 @@ fn test_proc_all_arithmetic() { #[test] fn test_proc_lambda_local_shadow_capture() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -356,7 +357,7 @@ fn test_proc_lambda_local_shadow_capture() { #[test] fn test_proc_upvars() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -415,7 +416,7 @@ fn test_proc_upvars() { #[test] fn test_proc_generators_nested() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -431,7 +432,7 @@ fn test_proc_generators_nested() { #[test] fn test_proc_call_in_closure() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -450,7 +451,7 @@ fn test_proc_call_in_closure() { #[test] fn test_proc_warp_yields() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = r#"0"#, fields = "", @@ -477,7 +478,7 @@ fn test_proc_warp_yields() { #[test] fn test_proc_string_ops() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -538,7 +539,7 @@ fn test_proc_string_ops() { #[test] fn test_proc_str_cmp_case_insensitive() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -560,7 +561,7 @@ fn test_proc_str_cmp_case_insensitive() { #[test] fn test_proc_rpc_call_basic() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -584,7 +585,7 @@ fn test_proc_rpc_call_basic() { #[test] fn test_proc_list_index_blocks() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -617,7 +618,7 @@ fn test_proc_list_index_blocks() { #[test] fn test_proc_literal_types() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -646,7 +647,7 @@ fn test_proc_say() { _ => CommandStatus::UseDefault { key, command }, })), }; - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, config, UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, config, Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -690,7 +691,7 @@ fn test_proc_syscall() { })), ..Default::default() }; - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, config, UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, config, Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -712,7 +713,7 @@ fn test_proc_syscall() { #[test] fn test_proc_timer_wait() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -731,7 +732,7 @@ fn test_proc_timer_wait() { #[test] fn test_proc_cons_cdr() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -758,7 +759,7 @@ fn test_proc_cons_cdr() { #[test] fn test_proc_list_find_contains() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -786,7 +787,7 @@ fn test_proc_list_find_contains() { #[test] fn test_proc_append() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -809,7 +810,7 @@ fn test_proc_append() { #[test] fn test_proc_foreach_mutate() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -829,7 +830,7 @@ fn test_proc_foreach_mutate() { #[test] fn test_proc_map() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = r#"0"#, fields = "", @@ -849,7 +850,7 @@ fn test_proc_map() { #[test] fn test_proc_keep_find() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = r#"0"#, fields = "", @@ -871,7 +872,7 @@ fn test_proc_keep_find() { #[test] fn test_proc_numeric_bases() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -893,7 +894,7 @@ fn test_proc_numeric_bases() { #[test] fn test_proc_combine() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = r#"0"#, fields = "", @@ -920,7 +921,7 @@ fn test_proc_combine() { #[test] fn test_proc_autofill_closure_params() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = r#"0"#, fields = "", @@ -942,7 +943,7 @@ fn test_proc_autofill_closure_params() { #[test] fn test_proc_pick_random() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1003,7 +1004,7 @@ fn test_proc_pick_random() { #[test] fn test_proc_rand_list_ops() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1057,7 +1058,7 @@ fn test_proc_rand_list_ops() { #[test] fn test_proc_variadic_sum_product() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1084,7 +1085,7 @@ fn test_proc_variadic_sum_product() { #[test] fn test_proc_variadic_min_max() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1100,7 +1101,7 @@ fn test_proc_variadic_min_max() { #[test] fn test_proc_atan2_new_cmp() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1125,7 +1126,7 @@ fn test_proc_atan2_new_cmp() { #[test] fn test_proc_list_columns() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1169,7 +1170,7 @@ fn test_proc_list_columns() { #[test] fn test_proc_transpose_consistency() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1195,7 +1196,7 @@ fn test_proc_transpose_consistency() { #[test] fn test_proc_compare_str() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1264,7 +1265,7 @@ fn test_proc_compare_str() { #[test] fn test_proc_new_min_max() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1293,7 +1294,7 @@ fn test_proc_new_min_max() { #[test] fn test_proc_flatten() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1314,7 +1315,7 @@ fn test_proc_flatten() { #[test] fn test_proc_list_len_rank_dims() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1340,7 +1341,7 @@ fn test_proc_list_len_rank_dims() { #[test] fn test_proc_string_index() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1363,7 +1364,7 @@ fn test_proc_string_index() { #[test] fn test_proc_type_query() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1392,7 +1393,7 @@ fn test_proc_type_query() { #[test] fn test_proc_variadic_strcat() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1413,7 +1414,7 @@ fn test_proc_variadic_strcat() { #[test] fn test_proc_list_lines() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1434,7 +1435,7 @@ fn test_proc_list_lines() { #[test] fn test_proc_whitespace_in_numbers() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1455,7 +1456,7 @@ fn test_proc_whitespace_in_numbers() { #[test] fn test_proc_binary_make_range() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1490,7 +1491,7 @@ fn test_proc_binary_make_range() { #[test] fn test_proc_identical_to() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1511,7 +1512,7 @@ fn test_proc_identical_to() { #[test] fn test_proc_variadic_list_ctors() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1539,7 +1540,7 @@ fn test_proc_variadic_list_ctors() { #[test] fn test_proc_list_rev() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1559,7 +1560,7 @@ fn test_proc_list_rev() { #[test] fn test_proc_list_reshape() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1595,7 +1596,7 @@ fn test_proc_list_reshape() { #[test] fn test_proc_list_json() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1618,7 +1619,7 @@ fn test_proc_list_json() { #[test] fn test_proc_explicit_to_string_cvt() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1644,7 +1645,7 @@ fn test_proc_explicit_to_string_cvt() { #[test] fn test_proc_empty_variadic_no_auto_insert() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1666,7 +1667,7 @@ fn test_proc_empty_variadic_no_auto_insert() { #[test] fn test_proc_c_ring_no_auto_insert() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1688,7 +1689,7 @@ fn test_proc_c_ring_no_auto_insert() { #[test] fn test_proc_signed_zero() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1713,7 +1714,7 @@ fn test_proc_signed_zero() { #[test] fn test_proc_singleton_sum_product() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1732,7 +1733,7 @@ fn test_proc_singleton_sum_product() { #[test] fn test_proc_list_combinations() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1776,7 +1777,7 @@ fn test_proc_list_combinations() { #[test] fn test_proc_unevaluated_inputs() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1794,7 +1795,7 @@ fn test_proc_unevaluated_inputs() { #[test] fn test_proc_index_over_bounds() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, ins_locs) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1817,7 +1818,7 @@ fn test_proc_index_over_bounds() { #[test] fn test_proc_neg_collab_ids() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, ins_locs) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1891,7 +1892,7 @@ fn test_proc_basic_motion() { }, }; - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, config, UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, config, Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1920,7 +1921,7 @@ fn test_proc_basic_motion() { #[test] fn test_proc_string_cmp() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -1941,7 +1942,7 @@ fn test_proc_string_cmp() { #[test] fn test_proc_stack_overflow() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, locs) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = r#"0"#, fields = r#"0"#, @@ -1980,7 +1981,7 @@ fn test_proc_stack_overflow() { #[test] fn test_proc_variadic_params() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2011,7 +2012,7 @@ fn test_proc_variadic_params() { #[test] fn test_proc_rand_str_char_cache() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2038,7 +2039,7 @@ fn test_proc_rand_str_char_cache() { #[test] fn test_proc_noop_upvars() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2054,7 +2055,7 @@ fn test_proc_noop_upvars() { #[test] fn test_proc_try_catch_throw() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2070,7 +2071,7 @@ fn test_proc_try_catch_throw() { #[test] fn test_proc_exception_unregister() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2086,7 +2087,7 @@ fn test_proc_exception_unregister() { #[test] fn test_proc_exception_rethrow() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2102,7 +2103,7 @@ fn test_proc_exception_rethrow() { #[test] fn test_proc_rpc_error() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2124,7 +2125,7 @@ fn test_proc_rpc_error() { #[test] fn test_proc_c_rings() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2148,7 +2149,7 @@ fn test_proc_c_rings() { #[test] fn test_proc_wall_time() { let utc_offset = UtcOffset::from_hms(5, 14, 20).unwrap(); - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), utc_offset)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(utc_offset)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2175,7 +2176,7 @@ fn test_proc_wall_time() { #[test] fn test_proc_to_csv() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2201,7 +2202,7 @@ fn test_proc_to_csv() { #[test] fn test_proc_from_csv() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2235,7 +2236,7 @@ fn test_proc_from_csv() { #[test] fn test_proc_extra_cmp_tests() { - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", @@ -2328,7 +2329,7 @@ fn test_proc_extra_blocks() { command: None, }; - let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, config, UtcOffset::UTC)); + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, config, Arc::new(FineClock::new(UtcOffset::UTC)))); let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), globals = "", fields = "", diff --git a/src/test/project.rs b/src/test/project.rs index 943165d..3b09964 100644 --- a/src/test/project.rs +++ b/src/test/project.rs @@ -1,6 +1,7 @@ use alloc::collections::BTreeSet; use alloc::borrow::ToOwned; use alloc::rc::Rc; +use alloc::sync::Arc; use crate::*; use crate::gc::*; @@ -58,7 +59,7 @@ fn run_till_term<'gc>(mc: &Mutation<'gc>, proj: &mut Project<'gc, C, StdSystem