Skip to content

Commit 8314057

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

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use std::collections::HashMap;
1919

2020
use serde_json::{Value, json, to_string_pretty};
2121
use tracing::Subscriber;
22+
use tracing_core::Interest;
2223
use tracing_core::event::Event;
2324
use tracing_core::metadata::Metadata;
2425
use tracing_core::span::{Attributes, Current, Id, Record};
@@ -69,6 +70,11 @@ impl TracingSubscriber {
6970
EVENTS.with(|events| events.borrow().clone())
7071
}
7172

73+
/// Returns all recorded spans as a HashMap
74+
pub fn get_all_spans(&self) -> HashMap<u64, Value> {
75+
SPANS.with(|spans| spans.borrow().clone())
76+
}
77+
7278
pub fn test_trace_records<F: Fn(&HashMap<u64, Value>, &Vec<Value>)>(&self, f: F) {
7379
SPANS.with(|spans| {
7480
EVENTS.with(|events| {
@@ -88,6 +94,13 @@ impl TracingSubscriber {
8894
}
8995

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

0 commit comments

Comments
 (0)