Skip to content

Commit f7698f4

Browse files
committed
CI: run ztest on compressed zpool
When running ztest under the CI a common failure mode is for the underlying filesystem to run out of available free space. Since the storage associated with a GitHub-hosted running is fixed, we instead create a pool and use a compressed ZFS dataset to store the ztest vdev files. This significantly increases the available capacity since the data written by ztest is highly compressible. A compression ratio of over 40:1 is conservatively achieved using the default lz4 compression. Autotrimming is enabled to ensure freed blocks are discarded from the backing cipool vdev file. Reviewed-by: Tino Reichardt <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #17501
1 parent 6c1130a commit f7698f4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/zloop.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
zloop:
1313
runs-on: ubuntu-24.04
1414
env:
15-
TEST_DIR: /var/tmp/zloop
15+
WORK_DIR: /mnt/zloop
16+
CORE_DIR: /mnt/zloop/cores
1617
steps:
1718
- uses: actions/checkout@v4
1819
with:
@@ -40,38 +41,37 @@ jobs:
4041
sudo modprobe zfs
4142
- name: Tests
4243
run: |
43-
sudo mkdir -p $TEST_DIR
44-
# run for 10 minutes or at most 6 iterations for a maximum runner
45-
# time of 60 minutes.
46-
sudo /usr/share/zfs/zloop.sh -t 600 -I 6 -l -m 1 -- -T 120 -P 60
44+
sudo truncate -s 256G /mnt/vdev
45+
sudo zpool create cipool -m $WORK_DIR -O compression=on -o autotrim=on /mnt/vdev
46+
sudo /usr/share/zfs/zloop.sh -t 600 -I 6 -l -m 1 -c $CORE_DIR -f $WORK_DIR -- -T 120 -P 60
4747
- name: Prepare artifacts
4848
if: failure()
4949
run: |
50-
sudo chmod +r -R $TEST_DIR/
50+
sudo chmod +r -R $WORK_DIR/
5151
- name: Ztest log
5252
if: failure()
5353
run: |
54-
grep -B10 -A1000 'ASSERT' $TEST_DIR/*/ztest.out || tail -n 1000 $TEST_DIR/*/ztest.out
54+
grep -B10 -A1000 'ASSERT' $CORE_DIR/*/ztest.out || tail -n 1000 $CORE_DIR/*/ztest.out
5555
- name: Gdb log
5656
if: failure()
5757
run: |
58-
sed -n '/Backtraces (full)/q;p' $TEST_DIR/*/ztest.gdb
58+
sed -n '/Backtraces (full)/q;p' $CORE_DIR/*/ztest.gdb
5959
- name: Zdb log
6060
if: failure()
6161
run: |
62-
cat $TEST_DIR/*/ztest.zdb
62+
cat $CORE_DIR/*/ztest.zdb
6363
- uses: actions/upload-artifact@v4
6464
if: failure()
6565
with:
6666
name: Logs
6767
path: |
68-
/var/tmp/zloop/*/
69-
!/var/tmp/zloop/*/vdev/
68+
/mnt/zloop/*/
69+
!/mnt/zloop/cores/*/vdev/
7070
if-no-files-found: ignore
7171
- uses: actions/upload-artifact@v4
7272
if: failure()
7373
with:
7474
name: Pool files
7575
path: |
76-
/var/tmp/zloop/*/vdev/
76+
/mnt/zloop/cores/*/vdev/
7777
if-no-files-found: ignore

0 commit comments

Comments
 (0)