Skip to content

Commit 7492c00

Browse files
authored
Merge pull request #34218 from bkirwi/future-metric
[ore] Fix a future metrics test
2 parents 93a45d0 + 9de72bc commit 7492c00

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

.config/nextest.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ priority = 60
109109
filter = "package(mz-repr) and test(row_packing_roundtrips_single_valued)"
110110
priority = 60
111111

112-
[[profile.default.overrides]]
113-
filter = "package(mz-ore) and test(smoke_test_metrics_future_ext)"
114-
threads-required = 8
115-
priority = 50
116-
117112
[profile.ci]
118113
junit = { path = "junit_cargo-test.xml" }
119114
fail-fast = false

src/ore/src/metrics.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ mod tests {
888888

889889
// Record the walltime and execution time of an async sleep.
890890
let async_sleep_future = async {
891-
tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
891+
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
892892
};
893893
runtime.block_on(
894894
async_sleep_future
@@ -910,9 +910,8 @@ mod tests {
910910

911911
let exec_histogram = exec_metric[0].get_histogram();
912912
assert_eq!(exec_histogram.get_sample_count(), 1);
913-
// The 4th bucket is 1ms, which we should complete faster than, but is still much quicker
914-
// than the 5 seconds we slept for.
915-
assert_eq!(exec_histogram.get_bucket()[3].cumulative_count(), 1);
913+
// This future will normally complete very quickly, but it's hard to guarantee any particular
914+
// timing in an arbitrary test environment, so we don't assert on it here.
916915

917916
let wall_family = reports
918917
.iter()

0 commit comments

Comments
 (0)