Skip to content

Commit

Permalink
CI: fix test timeout (#4872)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 authored May 20, 2024
1 parent c4c3933 commit 09404aa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/scripts/hypo/s3_op.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import hashlib
import json
import os
import re
import subprocess
try:
__import__('xattr')
Expand Down Expand Up @@ -66,7 +67,9 @@ def handleException(self, e, action, **kwargs):
message = output.get('error', {}).get('message', 'error message not found')
return Exception(f'returncode:{e.returncode} {message}')
except ValueError as ve:
return Exception(f'returncode:{e.returncode} output:{e.output.decode()}')
output = e.output.decode()
output = re.sub(r'\b\d+\.\d+\b|\b\d+\b', '***', output)
return Exception(f'returncode:{e.returncode} output:{output}')
else:
self.logger.info(f'{action} {kwargs} failed: {e}')
return e
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/command2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Run All
timeout-minutes: 70
run: |
timeout 3600 sudo -E LOG_LEVEL=WARNING META1=redis META2=${{matrix.meta}} .github/scripts/command/random.sh test_run_all || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then echo test failed; exit $code; fi
sudo -E LOG_LEVEL=WARNING META1=redis META2=${{matrix.meta}} timeout 3600 .github/scripts/command/random.sh test_run_all || code=$?; if [[ $code -eq 124 ]]; then echo test timeout with $code && exit 0; else echo failed with $code && exit $code; fi
- name: Upload example database
uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gateway2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ jobs:
- name: Test randomly
timeout-minutes: 65
run: |
timeout 3600 sudo -E LOG_LEVEL=WARNING python3 .github/scripts/hypo/s3.py 2>&1 | tee result.log || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then echo test failed; exit $code; fi
sudo -E LOG_LEVEL=WARNING timeout 3600 python3 .github/scripts/hypo/s3.py || code=$?; if [[ $code -eq 124 ]]; then echo test timeout with $code && exit 0; else echo test failed with $code && exit $code; fi
- name: Upload example database
uses: actions/upload-artifact@v3
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version_compatible_hypo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
echo old_version is $old_version
mv ${{matrix.old_juicefs_version}}/juicefs juicefs-$old_version
export OLD_JFS_BIN="juicefs-$old_version"
timeout 3600 python3 .github/scripts/testVersionCompatible.py 2>&1 | tee result.log || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then echo test failed; exit $code; fi
timeout 3600 python3 .github/scripts/testVersionCompatible.py 2>&1 | tee result.log || code=$?; if [[ $code -eq 124 ]]; then echo test timeout with $code; exit 0; else exit $code; fi
- name: Display result log
if: always()
Expand Down

0 comments on commit 09404aa

Please sign in to comment.