Disable use of system time in tests

This commit is contained in:
Emilia Hane
2023-02-14 13:33:38 +01:00
parent 148385eb70
commit 73c7ad73b8
29 changed files with 485 additions and 559 deletions

View File

@@ -7,7 +7,7 @@ use crate::beacon_processor::work_reprocessing_queue::{
use crate::beacon_processor::*;
use crate::{service::NetworkMessage, sync::SyncMessage};
use beacon_chain::test_utils::{
AttestationStrategy, BeaconChainHarness, BlockStrategy, EphemeralTestingSlotClockHarnessType,
AttestationStrategy, BeaconChainHarness, BlockStrategy, EphemeralHarnessType,
};
use beacon_chain::{BeaconChain, MAXIMUM_GOSSIP_CLOCK_DISPARITY};
use lighthouse_network::{
@@ -28,7 +28,7 @@ use types::{
};
type E = MainnetEthSpec;
type T = EphemeralTestingSlotClockHarnessType<E>;
type T = EphemeralHarnessType<E>;
const SLOTS_PER_EPOCH: u64 = 32;
const VALIDATOR_COUNT: usize = SLOTS_PER_EPOCH as usize;

View File

@@ -3,9 +3,7 @@
mod tests {
use crate::persisted_dht::load_dht;
use crate::{NetworkConfig, NetworkService};
use beacon_chain::test_utils::{
BeaconChainHarness, EphemeralSystemTimeSlotClockHarnessType as HarnessType,
};
use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType};
use lighthouse_network::Enr;
use slog::{o, Drain, Level, Logger};
use sloggers::{null::NullLoggerBuilder, Build};
@@ -36,7 +34,7 @@ mod tests {
fn test_dht_persistence() {
let log = get_logger(false);
let beacon_chain = BeaconChainHarness::<HarnessType<E>>::builder(E)
let beacon_chain = BeaconChainHarness::EphemeralHarnessType::<E>::builder(E)
.default_spec()
.deterministic_keypairs(8)
.fresh_ephemeral_store()

View File

@@ -9,9 +9,7 @@ use super::*;
use beacon_chain::{
builder::Witness,
eth1_chain::CachingEth1Backend,
test_utils::{
build_log, BeaconChainHarness, EphemeralSystemTimeSlotClockHarnessType as HarnessType,
},
test_utils::{build_log, BeaconChainHarness, EphemeralHarnessType},
};
pub use genesis::{interop_genesis_state, DEFAULT_ETH1_BLOCK_HASH};
use lighthouse_network::{NetworkGlobals, Request};
@@ -39,7 +37,7 @@ impl TestRig {
let log = build_log(slog::Level::Debug, enable_log);
// Initialise a new beacon chain
let harness = BeaconChainHarness::<HarnessType<E>>::builder(E::default())
let harness = BeaconChainHarness::<EphemeralHarnessType<E>>::builder(E::default())
.default_spec()
.logger(log.clone())
.deterministic_keypairs(1)

View File

@@ -381,9 +381,7 @@ mod tests {
builder::Witness,
eth1_chain::CachingEth1Backend,
parking_lot::RwLock,
test_utils::{
build_log, BeaconChainHarness, EphemeralSystemTimeSlotClockHarnessType as HarnessType,
},
test_utils::{build_log, BeaconChainHarness, EphemeralHarnessType},
EngineState,
};
use lighthouse_network::{
@@ -586,7 +584,7 @@ mod tests {
fn range(log_enabled: bool) -> (TestRig, RangeSync<TestBeaconChainType, FakeStorage>) {
let log = build_log(slog::Level::Trace, log_enabled);
// Initialise a new beacon chain
let harness = BeaconChainHarness::<HarnessType<E>>::builder(E::default())
let harness = BeaconChainHarness::<EphemeralHarnessType<E>>::builder(E::default())
.default_spec()
.logger(log.clone())
.deterministic_keypairs(1)