Skip to content

Commit

Permalink
Add test gc online
Browse files Browse the repository at this point in the history
  • Loading branch information
杨赫然 committed Nov 21, 2024
1 parent 87b0ce5 commit 7407b35
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_gc/test_gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def create_test_file():
fp.close()

large_file_name = 'large.txt'
large_file_size = 400*1024*1024
large_file_size = 500*1024*1024
large_file_path = os.getcwd() + '/' + large_file_name

def create_large_file():
Expand Down Expand Up @@ -147,9 +147,12 @@ def test_gc_partial_history(repo, rm_fs):
del_local_files()

def upload_file(url, m):
start = 0
end = large_file_size - 1
total = large_file_size
response = requests.post(url,
data = m, headers = {'Content-Type': m.content_type,
'Content-Range': 'bytes 0-419430399/419430400',
'Content-Range': f"bytes {start}-{end}/{total}",
'Content-Disposition': 'attachment; filename="large.txt"'})
return response.status_code, response.text

Expand Down Expand Up @@ -177,8 +180,8 @@ def test_gc_on_upload(repo, rm_fs):
offset = api.get_upload_tmp_file_offset(repo.id, "/" + large_file_name)
if offset == large_file_size:
break
time.sleep (0.5)
time.sleep (0.5)
time.sleep (0.1)
time.sleep(1)
run_gc(repo.id, rm_fs, '')

while not future.done():
Expand Down

0 comments on commit 7407b35

Please sign in to comment.