Skip to content

Commit 4036df0

Browse files
author
Habib Talib
committed
fix: complete platform gating validation
1 parent b57c329 commit 4036df0

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

nodedb-cluster/src/readiness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! no-op so the server builds and runs unchanged; `sd-notify` itself
1414
//! is only compiled in on Linux via a target-gated Cargo dependency.
1515
16-
use tracing::debug;
16+
use tracing::{debug, warn};
1717

1818
/// Signal that the server is fully initialised.
1919
///

nodedb-wal/tests/mmap_reader_madvise.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ use nodedb_wal::record::RecordType;
2424
use nodedb_wal::segmented::{SegmentedWal, SegmentedWalConfig};
2525
use tempfile::tempdir;
2626

27+
static OBSERVABILITY_LOCK: std::sync::Mutex<()> = std::sync::Mutex::new(());
28+
2729
fn tiny_segment_wal(wal_dir: &std::path::Path) -> SegmentedWal {
2830
let mut cfg = SegmentedWalConfig::for_testing(wal_dir.to_path_buf());
2931
// Tiny segments so a handful of appends forces rollover.
@@ -50,6 +52,7 @@ fn write_n_records(wal_dir: &std::path::Path, records: usize) -> Vec<u64> {
5052

5153
#[test]
5254
fn reader_open_advises_sequential() {
55+
let _guard = OBSERVABILITY_LOCK.lock().unwrap();
5356
let dir = tempdir().unwrap();
5457
let wal_dir = dir.path();
5558
write_n_records(wal_dir, 1);
@@ -66,6 +69,7 @@ fn reader_open_advises_sequential() {
6669

6770
#[test]
6871
fn replay_limit_from_last_segment_opens_only_last_segment() {
72+
let _guard = OBSERVABILITY_LOCK.lock().unwrap();
6973
let dir = tempdir().unwrap();
7074
let wal_dir = dir.path();
7175
write_n_records(wal_dir, 5);
@@ -89,6 +93,7 @@ fn replay_limit_from_last_segment_opens_only_last_segment() {
8993

9094
#[test]
9195
fn replay_skips_segments_entirely_below_from_lsn() {
96+
let _guard = OBSERVABILITY_LOCK.lock().unwrap();
9297
let dir = tempdir().unwrap();
9398
let wal_dir = dir.path();
9499
write_n_records(wal_dir, 4);
@@ -111,6 +116,7 @@ fn replay_skips_segments_entirely_below_from_lsn() {
111116

112117
#[test]
113118
fn replay_limit_returns_only_records_in_range() {
119+
let _guard = OBSERVABILITY_LOCK.lock().unwrap();
114120
// Behaviour spec: even with skipping, the set of returned records
115121
// must equal the set of records with lsn >= from_lsn, in LSN order.
116122
let dir = tempdir().unwrap();
@@ -128,6 +134,7 @@ fn replay_limit_returns_only_records_in_range() {
128134
#[test]
129135
#[cfg(target_os = "linux")]
130136
fn fadvise_dontneed_called_after_segment_iteration() {
137+
let _guard = OBSERVABILITY_LOCK.lock().unwrap();
131138
// Spec: after iterating a segment to end during replay, the fd's pages
132139
// must be hinted via POSIX_FADV_DONTNEED so replay doesn't retain
133140
// hot pages from segments that won't be read again.

0 commit comments

Comments
 (0)