Skip to content

Commit

Permalink
Merge branch 'main' into fix_remain_remove_concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
anysql committed Jan 17, 2025
2 parents 04fe7f3 + c8e0516 commit fab32fc
Show file tree
Hide file tree
Showing 38 changed files with 1,165 additions and 663 deletions.
514 changes: 514 additions & 0 deletions .github/scripts/cache.sh

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .github/scripts/check_juicefs_log.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e
for log_file in /var/log/juicefs.log $HOME/.juicefs/juicefs.log; do
if [ -f $log_file ]; then
break
fi
done
echo "tail -1000 $log_file"
tail -1000 $log_file
grep -i "<FATAL>\|panic" $log_file && exit 1 || true
147 changes: 0 additions & 147 deletions .github/scripts/command/cache.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/scripts/command/info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_info_big_file(){
prepare_test
./juicefs format $META_URL myjfs
./juicefs mount -d $META_URL /jfs
dd if=/dev/urandom of=/jfs/bigfile bs=16M count=1024
dd if=/dev/zero of=/jfs/bigfile bs=1M count=4096
./juicefs info /jfs/bigfile
./juicefs rmr /jfs/bigfile
df -h /jfs
Expand Down
32 changes: 16 additions & 16 deletions .github/scripts/hypo/fs_sdk_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ def test_issue_1424(self):
state.readline(file=v2, mode='r', offset=1708, user='root', whence=0)
state.teardown()

def test_issue_1425(self):
# SEE: https://github.com/juicedata/jfs/issues/1425
state = JuicefsMachine()
v1 = state.init_folders()
v2 = state.create_file(content=b'a', file_name='a', parent=v1, umask=18, user='root')
v3 = state.mkdir(mode=0, parent=v1, subdir='b', umask=18, user='root')
state.rename_dir(entry=v3, new_entry_name=v2, parent=v1, umask=18, user='root')
state.teardown()
# def test_issue_1425(self):
# # SEE: https://github.com/juicedata/jfs/issues/1425
# state = JuicefsMachine()
# v1 = state.init_folders()
# v2 = state.create_file(content=b'a', file_name='a', parent=v1, umask=18, user='root')
# v3 = state.mkdir(mode=0, parent=v1, subdir='b', umask=18, user='root')
# state.rename_dir(entry=v3, new_entry_name=v2, parent=v1, umask=18, user='root')
# state.teardown()

def test_issue_1442(self):
# SEE: https://github.com/juicedata/jfs/issues/1442
Expand All @@ -149,14 +149,14 @@ def test_issue_1442(self):
state.set_xattr(file=v2, flag=0, name='user.0', user='root', value=b'\x01\x01\x00\x01')
state.teardown()

def test_issue_1443(self):
# SEE: https://github.com/juicedata/jfs/issues/1443
state = JuicefsMachine()
v1 = state.init_folders()
v2 = state.create_file(content=b'bcb', file_name='bcba', parent=v1, umask=18, user='root')
v3 = state.hardlink(src_file=v2, link_file_name='a', parent=v1, umask=18, user='root')
state.rename_file(entry=v2, new_entry_name=v3, parent=v1, umask=18, user='root')
state.teardown()
# def test_issue_1443(self):
# # SEE: https://github.com/juicedata/jfs/issues/1443
# state = JuicefsMachine()
# v1 = state.init_folders()
# v2 = state.create_file(content=b'bcb', file_name='bcba', parent=v1, umask=18, user='root')
# v3 = state.hardlink(src_file=v2, link_file_name='a', parent=v1, umask=18, user='root')
# state.rename_file(entry=v2, new_entry_name=v3, parent=v1, umask=18, user='root')
# state.teardown()

def test_issue_1449(self):
# SEE: https://github.com/juicedata/jfs/issues/1449
Expand Down
8 changes: 3 additions & 5 deletions .github/scripts/hypo/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,11 @@ def equal(self, result1, result2):
@rule(target=Files,
parent = Folders.filter(lambda x: x != multiple()),
file_name = st_entry_name,
mode = st_open_mode,
content = st_content,
umask = st_umask,
)
def create_file(self, parent, file_name, content, mode='x', user='root', umask=0o022):
result1 = self.fsop1.do_create_file(parent, file_name, mode, content, user, umask)
result2 = self.fsop2.do_create_file(parent, file_name, mode, content, user, umask)
def create_file(self, parent, file_name, content='s', mode='x', user='root', umask=0o022):
result1 = self.fsop1.do_create_file(parent=parent, file_name=file_name, mode=mode, content=content, user=user, umask=umask)
result2 = self.fsop2.do_create_file(parent=parent, file_name=file_name, mode=mode, content=content, user=user, umask=umask)
assert self.equal(result1, result2), f'\033[31mcreate_file:\nresult1 is {result1}\nresult2 is {result2}\033[0m'
if isinstance(result1, Exception):
return multiple()
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/pysdk/pysdk_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def _test_link(self, file1, file2):
def test_link(self):
self._test_link(self.file1, self.file2)

@unittest.skip("Skipping SummaryTests")
class SummaryTests(unittest.TestCase):
# /test/dir1/file
# /dir2
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: "cache"

on:
push:
branches:
- 'main'
- 'release-**'
paths:
- '**/cache.yml'
- '**/cache.sh'
pull_request:
branches:
- 'main'
- 'release-**'
paths:
- '**/cache.yml'
- '**/cache.sh'
schedule:
- cron: '30 20 * * *'
workflow_dispatch:

jobs:
cache:
timeout-minutes: 60
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: mount coverage dir
timeout-minutes: 5
uses: ./.github/actions/mount-coverage-dir
with:
mount_point: cover
access_key: ${{ secrets.CI_COVERAGE_AWS_AK }}
secret_key: ${{ secrets.CI_COVERAGE_AWS_SK }}
token: ${{ secrets.CI_COVERAGE_AWS_TOKEN }}

- name: Build
timeout-minutes: 10
uses: ./.github/actions/build

- name: Test
run: |
sudo GOCOVERDIR=$(pwd)/cover .github/scripts/cache.sh
- name: Check juicefs log
if: always()
run: |
sudo .github/scripts/check_juicefs_log.sh
- name: Check /tmp/juicefs.log
if: always()
run: |
sudo tail -n 1000 /tmp/juicefs.log
- name: upload coverage report
timeout-minutes: 5
uses: ./.github/actions/upload-coverage
with:
UPLOAD_TOKEN: ${{ secrets.CI_COVERAGE_FILE_UPLOAD_AUTH_TOKEN }}

- name: Send Slack Notification
if: failure()
uses: juicedata/slack-notify-action@main
with:
channel-id: "${{ secrets.SLACK_CHANNEL_ID_FOR_PR_CHECK_NOTIFY }}"
slack_bot_token: "${{ secrets.SLACK_BOT_TOKEN }}"

- name: Setup upterm session
if: failure() && (github.event.inputs.debug == 'true' || github.run_attempt != 1)
# if: failure()
timeout-minutes: 60
uses: lhotari/action-upterm@v1
18 changes: 11 additions & 7 deletions .github/workflows/command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,44 +77,48 @@ jobs:
uses: ./.github/actions/build

- name: Test Gc
timeout-minutes: 30
timeout-minutes: 10
run: |
sudo META=${{matrix.meta}} .github/scripts/command/gc.sh
- name: Test Config
timeout-minutes: 10
run: |
sudo META=${{matrix.meta}} .github/scripts/command/config.sh
- name: Test acl
timeout-minutes: 30
timeout-minutes: 10
run: |
sudo META=${{matrix.meta}} .github/scripts/command/acl.sh
- name: Test Clone
timeout-minutes: 30
timeout-minutes: 10
run: |
sudo META=${{matrix.meta}} .github/scripts/command/clone.sh
- name: Test fsck
timeout-minutes: 30
timeout-minutes: 10
run: |
sudo META=${{matrix.meta}} .github/scripts/command/fsck.sh
- name: Test Gateway
timeout-minutes: 30
timeout-minutes: 10
run: |
sudo META=${{matrix.meta}} .github/scripts/command/gateway.sh
- name: Test Debug
timeout-minutes: 30
timeout-minutes: 10
run: |
sudo META=${{matrix.meta}} .github/scripts/command/debug.sh
- name: Test Info
timeout-minutes: 10
run: |
sudo META=${{matrix.meta}} .github/scripts/command/info.sh
- name: Test Format
if: false
timeout-minutes: 10
run: |
sudo META=${{matrix.meta}} .github/scripts/command/format.sh
Expand Down Expand Up @@ -239,7 +243,7 @@ jobs:
timeout-minutes: 30
run: |
if [[ "${{matrix.meta}}" == "mysql" || "${{matrix.meta}}" == "tikv" ]]; then
sudo META=${{matrix.meta}} .github/scripts/command/cache.sh
sudo META=${{matrix.meta}} .github/scripts/cache.sh
fi
- name: Test Graceful upgrade
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fsrand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
- name: check fsrand.log
if: always()
run: |
tail -500 fsrand.log
[[ -f fsrand.log ]] && tail -500 fsrand.log || true
- name: check juicefs.log
if: always()
Expand Down
Loading

0 comments on commit fab32fc

Please sign in to comment.