Skip to content

Commit 42aaf76

Browse files
committed
use scope for PartitionManager, fixing test_storage_kafka
1 parent 882c968 commit 42aaf76

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/integration/test_storage_kafka/test_batch_fast.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,8 +2269,6 @@ def test_kafka_no_holes_when_write_suffix_failed(kafka_cluster, create_query_gen
22692269
)
22702270

22712271
# init PartitionManager (it starts container) earlier
2272-
pm = PartitionManager()
2273-
22742272
instance.query(
22752273
"""
22762274
CREATE MATERIALIZED VIEW test.consumer TO test.view AS
@@ -2283,11 +2281,14 @@ def test_kafka_no_holes_when_write_suffix_failed(kafka_cluster, create_query_gen
22832281
# the tricky part here is that disconnect should happen after write prefix, but before write suffix
22842282
# we have 0.25 (sleepEachRow) * 20 ( Rows ) = 5 sec window after "Polled batch of 20 messages"
22852283
# while materialized view is working to inject zookeeper failure
2286-
pm.drop_instance_zk_connections(instance)
2287-
instance.wait_for_log_line(
2288-
"Error.*(Connection loss|Coordination::Exception).*while pushing to view"
2289-
)
2290-
pm.heal_all()
2284+
with PartitionManager() as pm:
2285+
pm.drop_instance_zk_connections(instance)
2286+
instance.wait_for_log_line(
2287+
"Error.*(Connection loss|Coordination::Exception).*while pushing to view",
2288+
timeout=60,
2289+
look_behind_lines=500
2290+
)
2291+
22912292
instance.wait_for_log_line("Committed offset 22")
22922293

22932294
result = instance.query(

0 commit comments

Comments
 (0)