Skip to content

Commit 456e521

Browse files
committed
tests: add GITTEST_SLOW env var check
Writing very large files may be slow, particularly on inefficient filesystems and when running instrumented code to detect invalid memory accesses (eg within valgrind or similar tools). Introduce `GITTEST_SLOW` so that tests that are slow can be skipped by the CI system.
1 parent bdb5421 commit 456e521

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

tests/odb/largefiles.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ void test_odb_largefiles__write_from_memory(void)
4545
cl_skip();
4646
#endif
4747

48-
if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE"))
49-
cl_skip();
50-
51-
if (!cl_is_env_set("GITTEST_INVASIVE_MEMORY"))
48+
if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE") ||
49+
!cl_is_env_set("GITTEST_INVASIVE_MEMORY") ||
50+
!cl_is_env_set("GITTEST_SLOW"))
5251
cl_skip();
5352

5453
for (i = 0; i < (3041*126103); i++)
@@ -64,7 +63,8 @@ void test_odb_largefiles__streamwrite(void)
6463
{
6564
git_oid expected, oid;
6665

67-
if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE"))
66+
if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE") ||
67+
!cl_is_env_set("GITTEST_SLOW"))
6868
cl_skip();
6969

7070
git_oid_fromstr(&expected, "3fb56989cca483b21ba7cb0a6edb229d10e1c26c");
@@ -82,10 +82,9 @@ void test_odb_largefiles__read_into_memory(void)
8282
cl_skip();
8383
#endif
8484

85-
if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE"))
86-
cl_skip();
87-
88-
if (!cl_is_env_set("GITTEST_INVASIVE_MEMORY"))
85+
if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE") ||
86+
!cl_is_env_set("GITTEST_INVASIVE_MEMORY") ||
87+
!cl_is_env_set("GITTEST_SLOW"))
8988
cl_skip();
9089

9190
writefile(&oid);
@@ -103,10 +102,9 @@ void test_odb_largefiles__read_into_memory_rejected_on_32bit(void)
103102
cl_skip();
104103
#endif
105104

106-
if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE"))
107-
cl_skip();
108-
109-
if (!cl_is_env_set("GITTEST_INVASIVE_MEMORY"))
105+
if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE") ||
106+
!cl_is_env_set("GITTEST_INVASIVE_MEMORY") ||
107+
!cl_is_env_set("GITTEST_SLOW"))
110108
cl_skip();
111109

112110
writefile(&oid);

0 commit comments

Comments
 (0)