diff options
Diffstat (limited to 'azalea-client')
| -rw-r--r-- | azalea-client/build.rs | 43 | ||||
| -rw-r--r-- | azalea-client/src/test_utils/simulation.rs | 16 | ||||
| -rw-r--r-- | azalea-client/src/test_utils/tracing.rs | 70 | ||||
| -rw-r--r-- | azalea-client/tests/main.rs | 1 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs (renamed from azalea-client/tests/change_dimension_to_nether_and_back.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/client_disconnect.rs (renamed from azalea-client/tests/client_disconnect.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/close_open_container.rs (renamed from azalea-client/tests/close_open_container.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/correct_movement.rs (renamed from azalea-client/tests/correct_movement.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/correct_sneak_movement.rs (renamed from azalea-client/tests/correct_sneak_movement.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/correct_sprint_sneak_movement.rs (renamed from azalea-client/tests/correct_sprint_sneak_movement.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/despawn_entities_when_changing_dimension.rs (renamed from azalea-client/tests/despawn_entities_when_changing_dimension.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/enchantments.rs (renamed from azalea-client/tests/enchantments.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/fast_login.rs (renamed from azalea-client/tests/fast_login.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/login_to_dimension_with_same_name.rs (renamed from azalea-client/tests/login_to_dimension_with_same_name.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/mine_block_rollback.rs (renamed from azalea-client/tests/mine_block_rollback.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/mine_block_timing_hand.rs (renamed from azalea-client/tests/mine_block_timing_hand.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/mine_block_without_rollback.rs (renamed from azalea-client/tests/mine_block_without_rollback.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/mod.rs | 25 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/move_and_despawn_entity.rs (renamed from azalea-client/tests/move_and_despawn_entity.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/move_despawned_entity.rs (renamed from azalea-client/tests/move_despawned_entity.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/packet_order.rs (renamed from azalea-client/tests/packet_order.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/packet_order_set_carried_item.rs (renamed from azalea-client/tests/packet_order_set_carried_item.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs (renamed from azalea-client/tests/receive_spawn_entity_and_start_config_packet.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/receive_start_config_packet.rs (renamed from azalea-client/tests/receive_start_config_packet.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/reply_to_ping_with_pong.rs (renamed from azalea-client/tests/reply_to_ping_with_pong.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/set_health_before_login.rs (renamed from azalea-client/tests/set_health_before_login.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/teleport_movement.rs (renamed from azalea-client/tests/teleport_movement.rs) | 2 | ||||
| -rw-r--r-- | azalea-client/tests/simulation/ticks_alive.rs (renamed from azalea-client/tests/ticks_alive.rs) | 2 |
28 files changed, 157 insertions, 44 deletions
diff --git a/azalea-client/build.rs b/azalea-client/build.rs new file mode 100644 index 00000000..49ef62db --- /dev/null +++ b/azalea-client/build.rs @@ -0,0 +1,43 @@ +use std::{ + fs::{self, File}, + io::Write, +}; + +fn main() { + // Tell Cargo that if the given file changes, to rerun this build script. + println!("cargo::rerun-if-changed=tests"); + + let Ok(paths) = fs::read_dir("tests/simulation") else { + return; + }; + + let mut modules = Vec::new(); + + for path in paths { + let Ok(path) = path else { + continue; + }; + let path = path.path(); + if path.extension().is_none_or(|ext| ext != "rs") { + continue; + } + let mod_name = path.with_extension(""); + let mod_name = mod_name.file_name().unwrap().to_string_lossy().to_string(); + if mod_name == "mod" { + continue; + } + modules.push(mod_name); + } + + let Ok(mut mod_rs) = File::create("tests/simulation/mod.rs") else { + return; + }; + let _ = writeln!( + mod_rs, + "// This file is @generated by `azalea-client/build.rs`.\n" + ); + modules.sort(); + for mod_name in modules { + let _ = writeln!(mod_rs, "mod {mod_name};"); + } +} diff --git a/azalea-client/src/test_utils/simulation.rs b/azalea-client/src/test_utils/simulation.rs index 5a1c9c52..a6bc22ab 100644 --- a/azalea-client/src/test_utils/simulation.rs +++ b/azalea-client/src/test_utils/simulation.rs @@ -57,8 +57,9 @@ pub struct Simulation { } impl Simulation { - pub fn new(initial_connection_protocol: ConnectionProtocol) -> Self { + pub fn new(conn_protocol: ConnectionProtocol) -> Self { let mut app = create_simulation_app(); + let mut entity = app.world_mut().spawn_empty(); let (player, rt) = create_local_player_bundle(entity.id(), ConnectionProtocol::Configuration); @@ -78,7 +79,7 @@ impl Simulation { let mut simulation = Self { app, entity, rt }; #[allow(clippy::single_match)] - match initial_connection_protocol { + match conn_protocol { ConnectionProtocol::Configuration => {} ConnectionProtocol::Game => { simulation.receive_packet(ClientboundRegistryData { @@ -97,7 +98,7 @@ impl Simulation { simulation.receive_packet(ClientboundFinishConfiguration); simulation.tick(); } - _ => unimplemented!("unsupported ConnectionProtocol {initial_connection_protocol:?}"), + _ => unimplemented!("unsupported ConnectionProtocol {conn_protocol:?}"), } simulation @@ -300,10 +301,13 @@ fn create_local_player_bundle( fn create_simulation_app() -> App { let mut app = App::new(); + let mut plugins = bevy_app::PluginGroup::build(crate::DefaultPlugins); #[cfg(feature = "log")] - app.add_plugins( - bevy_app::PluginGroup::build(crate::DefaultPlugins).disable::<bevy_log::LogPlugin>(), - ); + { + plugins = plugins.disable::<bevy_log::LogPlugin>(); + } + + app.add_plugins(plugins); app.edit_schedule(bevy_app::Main, |schedule| { // makes test results more reproducible diff --git a/azalea-client/src/test_utils/tracing.rs b/azalea-client/src/test_utils/tracing.rs index 207a4625..3be92260 100644 --- a/azalea-client/src/test_utils/tracing.rs +++ b/azalea-client/src/test_utils/tracing.rs @@ -1,27 +1,67 @@ +use std::sync::LazyLock; + use bevy_log::tracing_subscriber::{ - self, EnvFilter, Layer, + self, EnvFilter, Layer, Registry, + filter::Filtered, + fmt, layer::{Context, SubscriberExt}, + reload::{self, Handle}, util::SubscriberInitExt, }; +use parking_lot::{Mutex, MutexGuard}; use tracing::{Event, Level, Subscriber}; -pub fn init_tracing() { - init_tracing_with_level(Level::WARN); +static LOCK: LazyLock<Mutex<()>> = LazyLock::new(|| Mutex::new(())); + +pub fn init<'a>() -> MutexGuard<'a, ()> { + init_with_level(Level::WARN) +} + +// can't treat these as one layer due to https://github.com/tokio-rs/tracing/issues/1629 +struct LayerReloadHandles { + filter: Handle<Filtered<fmt::Layer<Registry>, EnvFilter, Registry>, Registry>, + test: Handle<TestTracingLayer, Registry>, } -pub fn init_tracing_with_level(max_level: Level) { +static RELOAD_HANDLES: LazyLock<LayerReloadHandles> = LazyLock::new(|| { + let (filter_layer, filter_reload_handle) = reload::Layer::new( + fmt::layer().with_filter( + EnvFilter::builder() + .with_default_directive(Level::WARN.into()) + .from_env_lossy(), + ), + ); + let (test_layer, test_reload_handle) = reload::Layer::new(TestTracingLayer { + panic_on_level: Level::WARN, + }); + tracing_subscriber::registry() - .with( - tracing_subscriber::fmt::layer().with_filter( - EnvFilter::builder() - .with_default_directive(max_level.into()) - .from_env_lossy(), - ), - ) - .with(TestTracingLayer { - panic_on_level: max_level, - }) + .with(filter_layer.and_then(test_layer)) .init(); + + LayerReloadHandles { + filter: filter_reload_handle, + test: test_reload_handle, + } +}); + +pub fn init_with_level<'a>(max_level: Level) -> MutexGuard<'a, ()> { + let lock = LOCK.lock(); + + RELOAD_HANDLES + .filter + .modify(|layer| { + *layer.filter_mut() = EnvFilter::builder() + .with_default_directive(max_level.into()) + .from_env_lossy() + }) + .unwrap(); + RELOAD_HANDLES + .test + .modify(|layer| layer.panic_on_level = max_level) + .unwrap(); + + lock } struct TestTracingLayer { @@ -31,7 +71,7 @@ impl<S: Subscriber> Layer<S> for TestTracingLayer { fn on_event(&self, event: &Event<'_>, _ctx: Context<'_, S>) { let level = *event.metadata().level(); if level <= self.panic_on_level { - panic!("logged on level {level}"); + panic!("Logged on level {level}."); } } } diff --git a/azalea-client/tests/main.rs b/azalea-client/tests/main.rs new file mode 100644 index 00000000..4030c61d --- /dev/null +++ b/azalea-client/tests/main.rs @@ -0,0 +1 @@ +mod simulation; diff --git a/azalea-client/tests/change_dimension_to_nether_and_back.rs b/azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs index 134c7cbf..2d4fb749 100644 --- a/azalea-client/tests/change_dimension_to_nether_and_back.rs +++ b/azalea-client/tests/simulation/change_dimension_to_nether_and_back.rs @@ -11,7 +11,7 @@ use simdnbt::owned::{NbtCompound, NbtTag}; #[test] fn test_change_dimension_to_nether_and_back() { - init_tracing(); + let _lock = init(); generic_test_change_dimension_to_nether_and_back(true); generic_test_change_dimension_to_nether_and_back(false); diff --git a/azalea-client/tests/client_disconnect.rs b/azalea-client/tests/simulation/client_disconnect.rs index fc17da0c..0956fbfa 100644 --- a/azalea-client/tests/client_disconnect.rs +++ b/azalea-client/tests/simulation/client_disconnect.rs @@ -4,7 +4,7 @@ use azalea_world::InstanceName; #[test] fn test_client_disconnect() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); diff --git a/azalea-client/tests/close_open_container.rs b/azalea-client/tests/simulation/close_open_container.rs index 32a9874d..033451f1 100644 --- a/azalea-client/tests/close_open_container.rs +++ b/azalea-client/tests/simulation/close_open_container.rs @@ -10,7 +10,7 @@ use azalea_registry::builtin::MenuKind; #[test] fn test_close_open_container() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); diff --git a/azalea-client/tests/correct_movement.rs b/azalea-client/tests/simulation/correct_movement.rs index de494111..2a1a8f26 100644 --- a/azalea-client/tests/correct_movement.rs +++ b/azalea-client/tests/simulation/correct_movement.rs @@ -15,7 +15,7 @@ use azalea_registry::builtin::BlockKind; #[test] fn test_correct_movement() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); let sent_packets = SentPackets::new(&mut simulation); diff --git a/azalea-client/tests/correct_sneak_movement.rs b/azalea-client/tests/simulation/correct_sneak_movement.rs index 1186ce8b..73abb26f 100644 --- a/azalea-client/tests/correct_sneak_movement.rs +++ b/azalea-client/tests/simulation/correct_sneak_movement.rs @@ -15,7 +15,7 @@ use azalea_registry::builtin::BlockKind; #[test] fn test_correct_sneak_movement() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); let sent_packets = SentPackets::new(&mut simulation); diff --git a/azalea-client/tests/correct_sprint_sneak_movement.rs b/azalea-client/tests/simulation/correct_sprint_sneak_movement.rs index 8ab955b8..a96c7024 100644 --- a/azalea-client/tests/correct_sprint_sneak_movement.rs +++ b/azalea-client/tests/simulation/correct_sprint_sneak_movement.rs @@ -15,7 +15,7 @@ use azalea_registry::builtin::BlockKind; #[test] fn test_correct_sprint_sneak_movement() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); let sent_packets = SentPackets::new(&mut simulation); diff --git a/azalea-client/tests/despawn_entities_when_changing_dimension.rs b/azalea-client/tests/simulation/despawn_entities_when_changing_dimension.rs index 466da948..8619bb2d 100644 --- a/azalea-client/tests/despawn_entities_when_changing_dimension.rs +++ b/azalea-client/tests/simulation/despawn_entities_when_changing_dimension.rs @@ -13,7 +13,7 @@ use simdnbt::owned::{NbtCompound, NbtTag}; #[test] fn test_despawn_entities_when_changing_dimension() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Configuration); simulation.receive_packet(ClientboundRegistryData { diff --git a/azalea-client/tests/enchantments.rs b/azalea-client/tests/simulation/enchantments.rs index 4486fba1..f9834230 100644 --- a/azalea-client/tests/enchantments.rs +++ b/azalea-client/tests/simulation/enchantments.rs @@ -11,7 +11,7 @@ use simdnbt::owned::{NbtCompound, NbtTag}; #[test] fn test_enchantments() { - init_tracing(); + let _lock = init(); let mut s = Simulation::new(ConnectionProtocol::Configuration); s.receive_packet(ClientboundRegistryData { diff --git a/azalea-client/tests/fast_login.rs b/azalea-client/tests/simulation/fast_login.rs index 5a653425..270f4464 100644 --- a/azalea-client/tests/fast_login.rs +++ b/azalea-client/tests/simulation/fast_login.rs @@ -10,7 +10,7 @@ use simdnbt::owned::{NbtCompound, NbtTag}; #[test] fn test_fast_login() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Configuration); assert!(simulation.has_component::<InConfigState>()); diff --git a/azalea-client/tests/login_to_dimension_with_same_name.rs b/azalea-client/tests/simulation/login_to_dimension_with_same_name.rs index 4adced62..917c50bb 100644 --- a/azalea-client/tests/login_to_dimension_with_same_name.rs +++ b/azalea-client/tests/simulation/login_to_dimension_with_same_name.rs @@ -14,7 +14,7 @@ use simdnbt::owned::{NbtCompound, NbtTag}; #[test] fn test_login_to_dimension_with_same_name() { - init_tracing(); + let _lock = init(); generic_test_login_to_dimension_with_same_name(true); generic_test_login_to_dimension_with_same_name(false); diff --git a/azalea-client/tests/mine_block_rollback.rs b/azalea-client/tests/simulation/mine_block_rollback.rs index 7d2ed1a5..98440f76 100644 --- a/azalea-client/tests/mine_block_rollback.rs +++ b/azalea-client/tests/simulation/mine_block_rollback.rs @@ -8,7 +8,7 @@ use azalea_registry::builtin::BlockKind; #[test] fn test_mine_block_rollback() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); simulation.receive_packet(default_login_packet()); diff --git a/azalea-client/tests/mine_block_timing_hand.rs b/azalea-client/tests/simulation/mine_block_timing_hand.rs index d3dd9c30..53571089 100644 --- a/azalea-client/tests/mine_block_timing_hand.rs +++ b/azalea-client/tests/simulation/mine_block_timing_hand.rs @@ -19,7 +19,7 @@ use azalea_registry::builtin::BlockKind; #[test] fn test_mine_block_timing_hand() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); let sent_packets = SentPackets::new(&mut simulation); diff --git a/azalea-client/tests/mine_block_without_rollback.rs b/azalea-client/tests/simulation/mine_block_without_rollback.rs index b6020ea2..71f360c4 100644 --- a/azalea-client/tests/mine_block_without_rollback.rs +++ b/azalea-client/tests/simulation/mine_block_without_rollback.rs @@ -8,7 +8,7 @@ use azalea_registry::builtin::BlockKind; #[test] fn test_mine_block_without_rollback() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); simulation.receive_packet(default_login_packet()); diff --git a/azalea-client/tests/simulation/mod.rs b/azalea-client/tests/simulation/mod.rs new file mode 100644 index 00000000..d090862b --- /dev/null +++ b/azalea-client/tests/simulation/mod.rs @@ -0,0 +1,25 @@ +// This file is @generated by `azalea-client/build.rs`. + +mod change_dimension_to_nether_and_back; +mod client_disconnect; +mod close_open_container; +mod correct_movement; +mod correct_sneak_movement; +mod correct_sprint_sneak_movement; +mod despawn_entities_when_changing_dimension; +mod enchantments; +mod fast_login; +mod login_to_dimension_with_same_name; +mod mine_block_rollback; +mod mine_block_timing_hand; +mod mine_block_without_rollback; +mod move_and_despawn_entity; +mod move_despawned_entity; +mod packet_order; +mod packet_order_set_carried_item; +mod receive_spawn_entity_and_start_config_packet; +mod receive_start_config_packet; +mod reply_to_ping_with_pong; +mod set_health_before_login; +mod teleport_movement; +mod ticks_alive; diff --git a/azalea-client/tests/move_and_despawn_entity.rs b/azalea-client/tests/simulation/move_and_despawn_entity.rs index 8a143243..6c334a47 100644 --- a/azalea-client/tests/move_and_despawn_entity.rs +++ b/azalea-client/tests/simulation/move_and_despawn_entity.rs @@ -12,7 +12,7 @@ use azalea_world::MinecraftEntityId; #[test] fn test_move_and_despawn_entity() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); simulation.receive_packet(default_login_packet()); diff --git a/azalea-client/tests/move_despawned_entity.rs b/azalea-client/tests/simulation/move_despawned_entity.rs index dad2a710..7a171dae 100644 --- a/azalea-client/tests/move_despawned_entity.rs +++ b/azalea-client/tests/simulation/move_despawned_entity.rs @@ -9,7 +9,7 @@ use tracing::Level; #[test] fn test_move_despawned_entity() { - init_tracing_with_level(Level::ERROR); // a warning is expected here + let _lock = init_with_level(Level::ERROR); // a warning is expected here let mut simulation = Simulation::new(ConnectionProtocol::Game); simulation.receive_packet(default_login_packet()); diff --git a/azalea-client/tests/packet_order.rs b/azalea-client/tests/simulation/packet_order.rs index 619ed0b6..ef99b938 100644 --- a/azalea-client/tests/packet_order.rs +++ b/azalea-client/tests/simulation/packet_order.rs @@ -15,7 +15,7 @@ use azalea_registry::builtin::BlockKind; #[test] fn test_packet_order() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); let sent_packets = SentPackets::new(&mut simulation); diff --git a/azalea-client/tests/packet_order_set_carried_item.rs b/azalea-client/tests/simulation/packet_order_set_carried_item.rs index e8ac386f..cae7c56a 100644 --- a/azalea-client/tests/packet_order_set_carried_item.rs +++ b/azalea-client/tests/simulation/packet_order_set_carried_item.rs @@ -21,7 +21,7 @@ use azalea_registry::builtin::BlockKind; #[test] fn test_packet_order_set_carried_item() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); let sent_packets = SentPackets::new(&mut simulation); diff --git a/azalea-client/tests/receive_spawn_entity_and_start_config_packet.rs b/azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs index dfb1fef9..13dd38fc 100644 --- a/azalea-client/tests/receive_spawn_entity_and_start_config_packet.rs +++ b/azalea-client/tests/simulation/receive_spawn_entity_and_start_config_packet.rs @@ -10,7 +10,7 @@ use uuid::Uuid; #[test] fn test_receive_spawn_entity_and_start_config_packet() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); simulation.receive_packet(default_login_packet()); diff --git a/azalea-client/tests/receive_start_config_packet.rs b/azalea-client/tests/simulation/receive_start_config_packet.rs index bb948488..f87d65da 100644 --- a/azalea-client/tests/receive_start_config_packet.rs +++ b/azalea-client/tests/simulation/receive_start_config_packet.rs @@ -4,7 +4,7 @@ use azalea_world::InstanceName; #[test] fn test_receive_start_config_packet() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); diff --git a/azalea-client/tests/reply_to_ping_with_pong.rs b/azalea-client/tests/simulation/reply_to_ping_with_pong.rs index 6b7cb4ca..f77bf4bf 100644 --- a/azalea-client/tests/reply_to_ping_with_pong.rs +++ b/azalea-client/tests/simulation/reply_to_ping_with_pong.rs @@ -18,7 +18,7 @@ use simdnbt::owned::{NbtCompound, NbtTag}; #[test] fn reply_to_ping_with_pong() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Configuration); diff --git a/azalea-client/tests/set_health_before_login.rs b/azalea-client/tests/simulation/set_health_before_login.rs index 4c1ec3f6..7d183b80 100644 --- a/azalea-client/tests/set_health_before_login.rs +++ b/azalea-client/tests/simulation/set_health_before_login.rs @@ -10,7 +10,7 @@ use simdnbt::owned::{NbtCompound, NbtTag}; #[test] fn test_set_health_before_login() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Configuration); assert!(simulation.has_component::<InConfigState>()); diff --git a/azalea-client/tests/teleport_movement.rs b/azalea-client/tests/simulation/teleport_movement.rs index 03df5b92..06a8f0b6 100644 --- a/azalea-client/tests/teleport_movement.rs +++ b/azalea-client/tests/simulation/teleport_movement.rs @@ -20,7 +20,7 @@ use azalea_world::MinecraftEntityId; #[test] fn test_teleport_movement() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); let sent_packets = SentPackets::new(&mut simulation); diff --git a/azalea-client/tests/ticks_alive.rs b/azalea-client/tests/simulation/ticks_alive.rs index f2081002..655504db 100644 --- a/azalea-client/tests/ticks_alive.rs +++ b/azalea-client/tests/simulation/ticks_alive.rs @@ -3,7 +3,7 @@ use azalea_protocol::packets::ConnectionProtocol; #[test] fn counter_increments_and_resets_on_disconnect() { - init_tracing(); + let _lock = init(); let mut simulation = Simulation::new(ConnectionProtocol::Game); simulation.tick(); |
