Skip to content

Commit 66fda96

Browse files
committed
test(graph): relax CREATE GRAPH INDEX timing budget on debug builds
The dispatch-batching regression guard asserts a wall-clock budget to distinguish a batched build (sub-second) from the serial per-document await loop (several seconds). Debug builds run unoptimized and several times slower, so a healthy batched build can exceed the 1s budget. Use a 5s budget under debug_assertions and keep 1s for release. The serial loop scales by the same factor into many seconds, so the guard still trips on a real regression.
1 parent 55c3b79 commit 66fda96

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

nodedb/tests/graph_ddl_create_graph_index.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,18 @@ async fn create_graph_index_batches_edge_dispatch() {
5050

5151
// Regression guard: timing. A serial per-doc await loop bursts past
5252
// this budget; a batched dispatch does not.
53-
let budget = Duration::from_secs(1);
53+
//
54+
// Debug builds run unoptimized (and on non-Linux lack io_uring), so the
55+
// *correct* batched path is several times slower — ~2 s vs sub-second in
56+
// release. Widen the budget for debug builds so the guard doesn't fire on
57+
// a healthy batched build, while keeping it far below the serial-loop
58+
// regime (which scales by the same factor into many seconds) so a real
59+
// regression still trips it.
60+
let budget = if cfg!(debug_assertions) {
61+
Duration::from_secs(5)
62+
} else {
63+
Duration::from_secs(1)
64+
};
5465
assert!(
5566
elapsed < budget,
5667
"CREATE GRAPH INDEX on {N} docs must batch edge dispatch; \

0 commit comments

Comments
 (0)