Unverified Commit 5b61b0dc authored by Oran Agra's avatar Oran Agra Committed by GitHub
Browse files

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..
parent 233abbbe
...@@ -406,7 +406,7 @@ jobs: ...@@ -406,7 +406,7 @@ jobs:
- name: unittest - name: unittest
if: true && !contains(github.event.inputs.skiptests, 'unittest') if: true && !contains(github.event.inputs.skiptests, 'unittest')
run: | 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 if grep -q 0x err.txt; then cat err.txt; exit 1; fi
test-valgrind-no-malloc-usable-size-test: test-valgrind-no-malloc-usable-size-test:
...@@ -463,7 +463,7 @@ jobs: ...@@ -463,7 +463,7 @@ jobs:
- name: unittest - name: unittest
if: true && !contains(github.event.inputs.skiptests, 'unittest') if: true && !contains(github.event.inputs.skiptests, 'unittest')
run: | 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 if grep -q 0x err.txt; then cat err.txt; exit 1; fi
test-sanitizer-address: test-sanitizer-address:
......
...@@ -6955,6 +6955,7 @@ int main(int argc, char **argv) { ...@@ -6955,6 +6955,7 @@ int main(int argc, char **argv) {
char *arg = argv[j]; char *arg = argv[j];
if (!strcasecmp(arg, "--accurate")) flags |= REDIS_TEST_ACCURATE; if (!strcasecmp(arg, "--accurate")) flags |= REDIS_TEST_ACCURATE;
else if (!strcasecmp(arg, "--large-memory")) flags |= REDIS_TEST_LARGE_MEMORY; 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")) { if (!strcasecmp(argv[2], "all")) {
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#define REDIS_TEST_ACCURATE (1<<0) #define REDIS_TEST_ACCURATE (1<<0)
#define REDIS_TEST_LARGE_MEMORY (1<<1) #define REDIS_TEST_LARGE_MEMORY (1<<1)
#define REDIS_TEST_VALGRIND (1<<2)
extern int __failed_tests; extern int __failed_tests;
extern int __test_num; extern int __test_num;
......
...@@ -1132,6 +1132,7 @@ int reclaimFilePageCache(int fd, size_t offset, size_t length) { ...@@ -1132,6 +1132,7 @@ int reclaimFilePageCache(int fd, size_t offset, size_t length) {
#ifdef REDIS_TEST #ifdef REDIS_TEST
#include <assert.h> #include <assert.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "testhelp.h"
static void test_string2ll(void) { static void test_string2ll(void) {
char buf[32]; char buf[32];
...@@ -1399,8 +1400,11 @@ int utilTest(int argc, char **argv, int flags) { ...@@ -1399,8 +1400,11 @@ int utilTest(int argc, char **argv, int flags) {
test_ld2string(); test_ld2string();
test_fixedpoint_d2string(); test_fixedpoint_d2string();
#if defined(__linux__) #if defined(__linux__)
test_reclaimFilePageCache(); if (!(flags & REDIS_TEST_VALGRIND)) {
test_reclaimFilePageCache();
}
#endif #endif
printf("Done testing util\n");
return 0; return 0;
} }
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment