Skip to content

Commit ef35afa

Browse files
committed
[debug commit]
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
1 parent 7e440eb commit ef35afa

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/ValidatePullRequest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- docs-pr
6868
- build-guests
6969
strategy:
70-
fail-fast: true
70+
fail-fast: false
7171
matrix:
7272
hypervisor: [hyperv, 'hyperv-ws2025', mshv3, kvm]
7373
cpu: [amd, intel]

src/hyperlight_testing/src/tracing_subscriber.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use tracing::Subscriber;
2222
use tracing_core::event::Event;
2323
use tracing_core::metadata::Metadata;
2424
use tracing_core::span::{Attributes, Current, Id, Record};
25-
use tracing_core::{Level, LevelFilter};
25+
use tracing_core::{Interest, Level, LevelFilter};
2626
use tracing_serde::AsSerde;
2727

2828
#[derive(Debug, Clone)]
@@ -69,6 +69,11 @@ impl TracingSubscriber {
6969
EVENTS.with(|events| events.borrow().clone())
7070
}
7171

72+
/// Returns all recorded spans as a HashMap
73+
pub fn get_all_spans(&self) -> HashMap<u64, Value> {
74+
SPANS.with(|spans| spans.borrow().clone())
75+
}
76+
7277
pub fn test_trace_records<F: Fn(&HashMap<u64, Value>, &Vec<Value>)>(&self, f: F) {
7378
SPANS.with(|spans| {
7479
EVENTS.with(|events| {
@@ -88,6 +93,13 @@ impl TracingSubscriber {
8893
}
8994

9095
impl Subscriber for TracingSubscriber {
96+
fn register_callsite(&self, _metadata: &'static Metadata<'static>) -> Interest {
97+
// Return Interest::sometimes() to prevent the global interest cache from caching
98+
// our decision. This avoids race conditions when running tests in parallel,
99+
// since each call to enabled() will be re-evaluated per-thread.
100+
Interest::sometimes()
101+
}
102+
91103
fn enabled(&self, metadata: &Metadata<'_>) -> bool {
92104
LEVEL_FILTER.with(|level_filter| metadata.level() <= &*level_filter.borrow())
93105
}

0 commit comments

Comments
 (0)