valkey-io / valkey

A new project to resume development on the formerly open-source Redis project. We're calling it Valkey, since it's a twist on the key-value datastore.
https://valkey.io
Other
14.09k stars 488 forks source link

Fix for Test Failures in Coverage Target (Issue #503) #504

Closed ouriamzn closed 2 weeks ago

ouriamzn commented 2 weeks ago

As discussed in Issue #503, some tests fail when building the coverage target. The root cause is the difference in how we handle the exit from child function during the build process. When building for coverage, we use exit(), which allows gcov to properly close all .gcda files. However, in the regular build, we use _exit(), which exits abruptly, preventing the child process coverage data from being recorded.

While using exit() resolves the issue with .gcda files, it introduces other problems that likely cause the tests to fail for coverage even though they usually pass.

My proposed solution is to continue using _exit() but to manually flush all .gcda files before the _exit() command is executed. This ensures that the coverage data is properly recorded without the additional issues caused by using exit().

ouriamzn commented 2 weeks ago

After multiple executions of the test, it seems like the test is a little flaky and not caused by this bug. I think it is best to close this pr as it is no longer relevant.