skip new page cache reclame unit test when running in valgrind (#11808)

the new test is incompatible with valgrind.
added a new `--valgrind` argument to `redis-server tests` mode,
which will cause that test to be skipped..
This commit is contained in:
Oran Agra 2023-02-16 10:50:58 +02:00 committed by GitHub
parent 233abbbe03
commit 5b61b0dc6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 3 deletions

View File

@ -406,7 +406,7 @@ jobs:
- name: unittest
if: true && !contains(github.event.inputs.skiptests, 'unittest')
run: |
valgrind --track-origins=yes --suppressions=./src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full --log-file=err.txt ./src/redis-server test all
valgrind --track-origins=yes --suppressions=./src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full --log-file=err.txt ./src/redis-server test all --valgrind
if grep -q 0x err.txt; then cat err.txt; exit 1; fi
test-valgrind-no-malloc-usable-size-test:
@ -463,7 +463,7 @@ jobs:
- name: unittest
if: true && !contains(github.event.inputs.skiptests, 'unittest')
run: |
valgrind --track-origins=yes --suppressions=./src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full --log-file=err.txt ./src/redis-server test all
valgrind --track-origins=yes --suppressions=./src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full --log-file=err.txt ./src/redis-server test all --valgrind
if grep -q 0x err.txt; then cat err.txt; exit 1; fi
test-sanitizer-address:

View File

@ -6955,6 +6955,7 @@ int main(int argc, char **argv) {
char *arg = argv[j];
if (!strcasecmp(arg, "--accurate")) flags |= REDIS_TEST_ACCURATE;
else if (!strcasecmp(arg, "--large-memory")) flags |= REDIS_TEST_LARGE_MEMORY;
else if (!strcasecmp(arg, "--valgrind")) flags |= REDIS_TEST_VALGRIND;
}
if (!strcasecmp(argv[2], "all")) {

View File

@ -41,6 +41,7 @@
#define REDIS_TEST_ACCURATE (1<<0)
#define REDIS_TEST_LARGE_MEMORY (1<<1)
#define REDIS_TEST_VALGRIND (1<<2)
extern int __failed_tests;
extern int __test_num;

View File

@ -1132,6 +1132,7 @@ int reclaimFilePageCache(int fd, size_t offset, size_t length) {
#ifdef REDIS_TEST
#include <assert.h>
#include <sys/mman.h>
#include "testhelp.h"
static void test_string2ll(void) {
char buf[32];
@ -1399,8 +1400,11 @@ int utilTest(int argc, char **argv, int flags) {
test_ld2string();
test_fixedpoint_d2string();
#if defined(__linux__)
test_reclaimFilePageCache();
if (!(flags & REDIS_TEST_VALGRIND)) {
test_reclaimFilePageCache();
}
#endif
printf("Done testing util\n");
return 0;
}
#endif