Skip to content

Commit

Permalink
Fixing kokoro timeout issue for perf test: Skipping testing folder wi…
Browse files Browse the repository at this point in the history
…th 1M files from HNS bucket from listing tests (#2430)

* skipping test case 1m files in HNS bucket

* updating config file for flat bucket
  • Loading branch information
anushka567 authored Sep 2, 2024
1 parent c5c8c30 commit 6677f9c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
8 changes: 7 additions & 1 deletion perfmetrics/scripts/ls_metrics/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "list-benchmark-tests" ,
"num_folders": 11 ,
"num_folders": 12 ,
"folders": [
{
"name": "1KB_1000files_0subdir" ,
Expand Down Expand Up @@ -67,6 +67,12 @@
"num_files": 200000 ,
"file_name_prefix": "file" ,
"file_size": "1kb"
},
{
"name": "1KB_1000000files_0subdir" ,
"num_files": 1000000 ,
"file_name_prefix": "file" ,
"file_size": "1kb"
}
]
}
18 changes: 18 additions & 0 deletions perfmetrics/scripts/ls_metrics/listing_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
details of the tests.
Note: This python script is dependent on generate_files.py.
Note: This script currently skips folder with 1000000 files to facilitate periodic kokoro tests
without timeout .To run that test case, comment out lines [124-126],[180-182],[259-261],[317-319],[377-379]
"""

import argparse
Expand Down Expand Up @@ -119,6 +121,9 @@ def _get_values_to_export(folders, metrics, command) -> list:

list_metrics_data = []
for testing_folder in folders:
if testing_folder.name == "1KB_1000000files_0subdir":
# Excluding test case with 1m files from HNS in daily periodic tests.
continue
num_files, num_folders = _count_number_of_files_and_folders(
testing_folder, 0, 0)
row = [
Expand Down Expand Up @@ -172,6 +177,9 @@ def _parse_results(folders, results_list, message, num_samples) -> dict:
metrics = dict()

for testing_folder in folders:
if testing_folder.name == "1KB_1000000files_0subdir":
# Excluding test case with 1m files from HNS in daily periodic tests.
continue
metrics[testing_folder.name] = dict()
metrics[testing_folder.name]['Test Desc.'] = message
metrics[testing_folder.name]['Number of samples'] = num_samples
Expand Down Expand Up @@ -248,6 +256,10 @@ def _perform_testing(
persistent_disk_results = {}

for testing_folder in folders:
if testing_folder.name == "1KB_1000000files_0subdir":
# Excluding test case with 1m files from HNS in daily periodic tests.
continue

log.info('Testing started for testing folder: %s\n', testing_folder.name)
local_dir_path = './{}/{}/'.format(persistent_disk, testing_folder.name)
gcs_bucket_path = './{}/{}/'.format(gcs_bucket, testing_folder.name)
Expand Down Expand Up @@ -302,6 +314,9 @@ def _create_directory_structure(

result = 0
for folder in directory_structure.folders:
if folder.name == "1KB_1000000files_0subdir":
# Excluding test case with 1m files from HNS in daily periodic tests.
continue
result += _create_directory_structure(gcs_bucket_url + folder.name + '/',
persistent_disk_url + folder.name + '/',
folder, create_files_in_gcs)
Expand Down Expand Up @@ -359,6 +374,9 @@ def _compare_directory_structure(url, directory_structure) -> bool:

result = True
for folder in directory_structure.folders:
if folder.name == "1KB_1000000files_0subdir":
# Excluding test case with 1m files from HNS in daily periodic tests.
continue
new_url = url + folder.name + '/'
if new_url not in folders:
return False
Expand Down

0 comments on commit 6677f9c

Please sign in to comment.