fix: remove a flaky set_error test
set_error
was a flaky test due to a not thread-safe nature of mallinfo
. We decided to remove it altogether after we check that tarantool::set_error!
does not leak.
Demo
I made a simple demo with set_error
macro calls that can be checked with valgrind: https://git.picodata.io/picodata/picodata/tarantool-module/-/tree/check-set-error
Setup
I ran the check in the following way:
cargo build -p set-error-test
valgrind --leak-check=yes tarantool set-error-test/run.lua
There I added two Rust function calls:
-
set_error
executed 100 times -
leak_mem
which definitely leaks memory withstd::mem::forget
Results
When both function calls were commented out, valgrind reports:
definitely lost: 1,864 bytes in 4 blocks
When leak_mem
only commented out:
definitely lost: 1,864 bytes in 4 blocks
When set_error
only commented out:
definitely lost: 4,001,864 bytes in 5 blocks
Also for leak_mem
valgrind showed a clear leak in Vec
, nothing like that was shown for set_error
.
I believe these proves that set_error!
is leak free and we can remove this test.