Skip to content

Commit 18cb2fa

Browse files
committed
Stabilize the runtime of libtest-padding
The body of these benchmarks is close to empty but not literally empty. This was making the runtime of the benchmarks (which are compiled without optimizations!) flicker between 9 ns and 10 ns runtime, which changes the padding and breaks the test. Recent changes to the standard library have pushed the runtime closer to 10 ns when unoptimized, which is why we haven't seen such failures before in CI. Contributors can also induce such failures before this PR by running the run-make tests while the system is under heavy load.
1 parent 72b7171 commit 18cb2fa

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/run-make/libtest-padding/tests.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ fn short_test_name() {}
88
fn this_is_a_really_long_test_name() {}
99

1010
#[bench]
11-
fn short_bench_name(b: &mut test::Bencher) {
12-
b.iter(|| 1);
13-
}
11+
fn short_bench_name(b: &mut test::Bencher) {}
1412

1513
#[bench]
16-
fn this_is_a_really_long_bench_name(b: &mut test::Bencher) {
17-
b.iter(|| 1);
18-
}
14+
fn this_is_a_really_long_bench_name(b: &mut test::Bencher) {}

0 commit comments

Comments
 (0)