Skip to content

Commit 71bd145

Browse files
fix(trace_exporter): fix flaky tests for shutdown (#1074)
1 parent 87dbb16 commit 71bd145

File tree

1 file changed

+10
-1
lines changed
  • data-pipeline/src/trace_exporter

1 file changed

+10
-1
lines changed

data-pipeline/src/trace_exporter/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,15 @@ mod tests {
12791279

12801280
exporter.shutdown(None).unwrap();
12811281

1282+
// Wait for the mock server to process the stats
1283+
for _ in 0..10 {
1284+
if mock_traces.hits() > 0 && mock_stats.hits() > 0 {
1285+
break;
1286+
} else {
1287+
std::thread::sleep(Duration::from_millis(100));
1288+
}
1289+
}
1290+
12821291
mock_traces.assert();
12831292
mock_stats.assert();
12841293
}
@@ -1352,7 +1361,7 @@ mod tests {
13521361
exporter.send(data.as_ref(), 1).unwrap();
13531362

13541363
exporter
1355-
.shutdown(Some(Duration::from_millis(500)))
1364+
.shutdown(Some(Duration::from_millis(5)))
13561365
.unwrap_err(); // The shutdown should timeout
13571366

13581367
mock_traces.assert();

0 commit comments

Comments
 (0)