diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-06-08 12:08:28 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-06-08 12:08:28 +0300 |
commit | 0c6b00ff9fc6e7bee29a79b07e26cb993c6d3f99 (patch) | |
tree | 3644c46d6ec7adfd7416b5e01bcb32e1e57a9852 /.gitlab-ci.yml | |
parent | 468ba7de9380a1eb6321dbdf9b7ddffd7eda90f7 (diff) |
ci: Speed up tests by writing test data to tmpfs
It seems like part of our slowness in CI systems boils down to all the
data we're writing. The I/O seemingly causes quite some disk contention
and thus slows the tests down.
Convert our tests to use tmpfs. For uncached test runs this decreases
the test execution time from around 579 to 509 seconds, which is more
than a minute and thus considered a (small) win.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7eec0c517..0ddf6a059 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -101,8 +101,13 @@ workflow: TEST_JSON_REPORT: "${CI_PROJECT_DIR}/_build/reports/test-report.json" TEST_LOG_DIR: "${CI_PROJECT_DIR}/_build/reports/test-logs" TEST_OPTIONS: "-count=1 -timeout=20m" # a number of tests may exceed the default 10m + TEST_TMP_DIR: "/tmp" TEST_WITH_COVERAGE: YesPlease before_script: &test_before_script + # Speed up test execution by writing test data into tmpfs instead of onto + # the underlying disk. + - chmod 1777 "${TEST_TMP_DIR}" + - mount none -t tmpfs -o size=2G "${TEST_TMP_DIR}" - go version script: # Create the build directory for the unprivileged user that we're running @@ -305,9 +310,8 @@ test:fips: <<: *test_variables CACHE_PREFIX: ubi-${UBI_VERSION} before_script: - - test "$(cat /proc/sys/crypto/fips_enabled)" = "1" || (echo "System is not running in FIPS mode" && exit 1) - - chmod +t /tmp - *test_before_script + - test "$(cat /proc/sys/crypto/fips_enabled)" = "1" || (echo "System is not running in FIPS mode" && exit 1) parallel: matrix: - TEST_TARGET: [ test, test-with-praefect ] |