Merge pull request #49996 from ClickHouse/az

Fix test_insert_same_partition_and_merge failing if one Azure request attempt fails
This commit is contained in:
alesapin 2023-05-19 12:58:47 +02:00 committed by GitHub
commit 632ab8a3d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -51,7 +51,7 @@ void WriteBufferFromAzureBlobStorage::execWithRetry(std::function<void()> func,
if (i == num_tries - 1) if (i == num_tries - 1)
throw; throw;
LOG_DEBUG(log, "Write at attempt {} for blob `{}` failed: {}", i + 1, blob_path, e.Message); LOG_DEBUG(log, "Write at attempt {} for blob `{}` failed: {} {}", i + 1, blob_path, e.what(), e.Message);
}; };
for (size_t i = 0; i < num_tries; ++i) for (size_t i = 0; i < num_tries; ++i)

View File

@ -203,7 +203,7 @@ def test_insert_same_partition_and_merge(cluster, merge_vertical):
node.query(f"SYSTEM START MERGES {TABLE_NAME}") node.query(f"SYSTEM START MERGES {TABLE_NAME}")
# Wait for merges and old parts deletion # Wait for merges and old parts deletion
for attempt in range(0, 10): for attempt in range(0, 60):
parts_count = azure_query( parts_count = azure_query(
node, node,
f"SELECT COUNT(*) FROM system.parts WHERE table = '{TABLE_NAME}' FORMAT Values", f"SELECT COUNT(*) FROM system.parts WHERE table = '{TABLE_NAME}' FORMAT Values",
@ -211,7 +211,7 @@ def test_insert_same_partition_and_merge(cluster, merge_vertical):
if parts_count == "(1)": if parts_count == "(1)":
break break
if attempt == 9: if attempt == 59:
assert parts_count == "(1)" assert parts_count == "(1)"
time.sleep(1) time.sleep(1)

View File

@ -232,7 +232,7 @@ def test_insert_same_partition_and_merge(cluster, merge_vertical, node_name):
node.query("SYSTEM START MERGES s3_test") node.query("SYSTEM START MERGES s3_test")
# Wait for merges and old parts deletion # Wait for merges and old parts deletion
for attempt in range(0, 10): for attempt in range(0, 60):
parts_count = node.query( parts_count = node.query(
"SELECT COUNT(*) FROM system.parts WHERE table = 's3_test' and active = 1 FORMAT Values" "SELECT COUNT(*) FROM system.parts WHERE table = 's3_test' and active = 1 FORMAT Values"
) )
@ -240,7 +240,7 @@ def test_insert_same_partition_and_merge(cluster, merge_vertical, node_name):
if parts_count == "(1)": if parts_count == "(1)":
break break
if attempt == 9: if attempt == 59:
assert parts_count == "(1)" assert parts_count == "(1)"
time.sleep(1) time.sleep(1)