Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 committed Jan 9, 2025
1 parent fbaa83f commit 551fb99
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions .github/scripts/command/cache.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/bash -ex
dpkg -s redis-server || .github/scripts/apt_install.sh redis-tools redis-server
source .github/scripts/common/common.sh
source .github/scripts/start_meta_engine.sh
Expand All @@ -11,24 +11,23 @@ test_batch_warmup(){
prepare_test
./juicefs format $META_URL myjfs --trash-days 0
./juicefs mount $META_URL /tmp/jfs -d
rm -f file.list
file_count=11000
for i in $(seq 1 $file_count); do
echo $i > /tmp/jfs/test_$i
echo /tmp/jfs/test_$i >> file.list
done
time seq 1 $file_count | xargs -P 8 -I {} sh -c 'echo {} > /tmp/jfs/test_{}; echo /tmp/jfs/test_{} >> file.list'
# time for i in $(seq 1 $file_count); do echo $i > /tmp/jfs/test_$i; echo /tmp/jfs/test_$i >> file.list; done
./juicefs warmup -f file.list 2>&1 | tee warmup.log
files=$(grep -oP 'warmup cache: \K[0-9]+' warmup.log)
files=$(sed -n 's/.*cache: \([0-9]\+\) files.*/\1/p' warmup.log)
[[ $files -ne $file_count ]] && echo "warmup failed, expect $file_count files, actual $files" && exit 1 || true
./juicefs warmup -f file.list --check 2>&1 | tee warmup.log
files=$(grep -oP 'warmup cache: \K[0-9]+' warmup.log)
files=$(sed -n 's/.*cache: \([0-9]\+\) files.*/\1/p' warmup.log)
[[ $files -ne $file_count ]] && echo "warmup failed, expect $file_count files, actual $files" && exit 1 || true
grep "(100.0%)" warmup.log || (echo "warmup failed, expect 100.0% warmup" && exit 1)

./juicefs warmup -f file.list --evict 2>&1 | tee warmup.log
files=$(grep -oP 'warmup cache: \K[0-9]+' warmup.log)
files=$(sed -n 's/.*cache: \([0-9]\+\) files.*/\1/p' warmup.log)
[[ $files -ne $file_count ]] && echo "warmup failed, expect $file_count files, actual $files" && exit 1 || true
./juicefs warmup -f file.list --check 2>&1 | tee warmup.log
files=$(grep -oP 'warmup cache: \K[0-9]+' warmup.log)
files=$(sed -n 's/.*cache: \([0-9]\+\) files.*/\1/p' warmup.log)
[[ $files -ne $file_count ]] && echo "warmup failed, expect $file_count files, actual $files" && exit 1 || true
grep "(0.0%)" warmup.log || (echo "warmup failed, expect 0.0% warmup" && exit 1)
}
Expand Down

0 comments on commit 551fb99

Please sign in to comment.