Skip to content

Commit 365add0

Browse files
committed
fuzz/fuzz-hsm_encryption: don't run as unit test under valgrind.
Thanks to Argon hashing, this is intolerably slow under valgrind, and times out under CI. Signed-off-by: Rusty Russell <[email protected]>
1 parent 2adfdfd commit 365add0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/fuzz/fuzz-hsm_encryption.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33

44
#include <ccan/mem/mem.h>
55
#include <common/hsm_encryption.h>
6+
#include <common/setup.h>
7+
#include <stdlib.h>
68
#include <tests/fuzz/libfuzz.h>
79

810
void init(int *argc, char ***argv)
911
{
12+
/* Don't run as a unit test under valgrind: too slow! */
13+
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
14+
if (getenv("VALGRIND") && strcmp(getenv("VALGRIND"), "1") == 0) {
15+
common_shutdown();
16+
exit(0);
17+
}
18+
#endif
1019
}
1120

1221
void run(const uint8_t *data, size_t size)

0 commit comments

Comments
 (0)