From b44d926f3e5a6fde18d336292ca4659a6c1d7395 Mon Sep 17 00:00:00 2001 From: Egor Lazarchuk Date: Thu, 28 Nov 2024 10:14:56 +0000 Subject: [PATCH] chore(unit-tests): disable debug-assertions in test builds We need to do this because we have tests which create Files from a raw fds or do an explicit close on fds. This causes UB check to trigger and test to panic. There is no separate flag to disable these checks, so we have to disable all debug-assertions in test builds. Tracking issue: https://github.com/rust-lang/rust/issues/123499 Signed-off-by: Egor Lazarchuk --- Cargo.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 4f8cc3f5eb5..7866aacf387 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,14 @@ tests_outside_test_module = "warn" assertions_on_result_states = "warn" error_impl_error = "warn" +[profile.test] +# Some unit tests create files from raw fds and +# this triggers UB checks to panic. There is no +# separate flag to disable those as of right now, +# so we have to disable debug-assertions. +# Tracking issue: https://github.com/rust-lang/rust/issues/123499 +debug-assertions = false + [profile.dev] panic = "abort"