Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions crates/openshell-server/src/compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6148,6 +6148,17 @@ mod tests {
.await
.unwrap();

tokio::time::timeout(Duration::from_secs(5), async {
while traced
.spans_named("driver_watch.sandbox_deleted")
.is_empty()
{
tokio::time::sleep(Duration::from_millis(10)).await;
}
})
.await
.expect("the event records a span of its own");

let spans = traced.finished_spans();
let root = spans
.iter()
Expand Down Expand Up @@ -6193,9 +6204,14 @@ mod tests {
.await
.unwrap();

// Other tests drive their own reconcile loops into the shared
// exporter, so match on the shape of a sweep rather than assuming
// there is exactly one.
tokio::time::timeout(Duration::from_secs(5), async {
while traced.spans_named("reconcile.sandboxes").is_empty() {
tokio::time::sleep(Duration::from_millis(10)).await;
}
})
.await
.expect("the sweep records a span of its own");

let spans = traced.finished_spans();
let roots = traced.spans_named("reconcile.sandboxes");
assert!(
Expand Down
12 changes: 12 additions & 0 deletions crates/openshell-server/src/provider_refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,7 @@ async fn run_refresh_worker_tick(store: &Store) -> Result<(), Status> {
let span = tracing::Span::current();
span.record("watched_count", watched_count);
span.record("due_count", due_count);
drop(span);
info!(
watched_count,
due_count, rotation_requested_count, "provider credential refresh worker sweep"
Expand Down Expand Up @@ -1534,6 +1535,17 @@ mod tests {
let traced = test_exporter::install_traced();
run_refresh_worker_tick(&store).await.unwrap();

tokio::time::timeout(std::time::Duration::from_secs(5), async {
while traced
.spans_named("refresh.provider_credentials")
.is_empty()
{
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
}
})
.await
.expect("the tick records a span of its own");

let spans = traced.finished_spans();
let root = spans
.iter()
Expand Down
Loading