Skip to content

Commit

Permalink
Improved test
Browse files Browse the repository at this point in the history
  • Loading branch information
zliang-akamai committed Jul 31, 2024
1 parent ba6ed16 commit 67cf8df
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions tests/integration/obj/test_obj_plugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import logging
from concurrent.futures import ThreadPoolExecutor, wait
from dataclasses import dataclass
from typing import Callable, Optional

Expand Down Expand Up @@ -210,25 +211,29 @@ def test_multi_files_multi_bucket(
assert "Done" in output


@pytest.mark.skip(reason="Long run test case")
def test_large_number_of_files_single_bucket(
@pytest.mark.parametrize("num_files", [1005])
def test_large_number_of_files_single_bucket_parallel(
create_bucket: Callable[[Optional[str]], str],
generate_test_files: GetTestFilesType,
keys: Keys,
monkeypatch: MonkeyPatch,
num_files: int,
):
patch_keys(keys, monkeypatch)

number = 1005
bucket_name = create_bucket()
file_paths = generate_test_files(number)
for file in file_paths:
process = exec_test_command(
BASE_CMD + ["put", str(file.resolve()), bucket_name]
)
output = process.stdout.decode()
assert "100.0%" in output
assert "Done" in output
file_paths = generate_test_files(num_files)

with ThreadPoolExecutor(50) as executor:
futures = [
executor.submit(
exec_test_command,
BASE_CMD + ["put", str(file.resolve()), bucket_name],
)
for file in file_paths
]

wait(futures)


def test_all_rows(
Expand Down

0 comments on commit 67cf8df

Please sign in to comment.