@@ -381,10 +381,6 @@ class CallbackError(Exception):
381381 with pytest .raises (CallbackError ):
382382 future .result (timeout = 30 )
383383
384- @pytest .mark .xfail (
385- reason = "The default stream ACK deadline is static and received messages "
386- "exceeding FlowControl.max_messages are currently not lease managed."
387- )
388384 def test_streaming_pull_ack_deadline (
389385 self , publisher , subscriber , project , topic_path , subscription_path , cleanup
390386 ):
@@ -399,29 +395,29 @@ def test_streaming_pull_ack_deadline(
399395 # Subscribe to the topic. This must happen before the messages
400396 # are published.
401397 subscriber .create_subscription (
402- subscription_path , topic_path , ack_deadline_seconds = 240
398+ subscription_path , topic_path , ack_deadline_seconds = 45
403399 )
404400
405401 # publish some messages and wait for completion
406402 self ._publish_messages (publisher , topic_path , batch_sizes = [2 ])
407403
408404 # subscribe to the topic
409405 callback = StreamingPullCallback (
410- processing_time = 70 , # more than the default stream ACK deadline (60s )
406+ processing_time = 13 , # more than the default stream ACK deadline (10s )
411407 resolve_at_msg_count = 3 , # one more than the published messages count
412408 )
413409 flow_control = types .FlowControl (max_messages = 1 )
414410 subscription_future = subscriber .subscribe (
415411 subscription_path , callback , flow_control = flow_control
416412 )
417413
418- # We expect to process the first two messages in 2 * 70 seconds, and
414+ # We expect to process the first two messages in 2 * 13 seconds, and
419415 # any duplicate message that is re-sent by the backend in additional
420- # 70 seconds, totalling 210 seconds (+ overhead) --> if there have been
421- # no duplicates in 240 seconds, we can reasonably assume that there
416+ # 13 seconds, totalling 39 seconds (+ overhead) --> if there have been
417+ # no duplicates in 60 seconds, we can reasonably assume that there
422418 # won't be any.
423419 try :
424- callback .done_future .result (timeout = 240 )
420+ callback .done_future .result (timeout = 60 )
425421 except exceptions .TimeoutError :
426422 # future timed out, because we received no excessive messages
427423 assert sorted (callback .seen_message_ids ) == [1 , 2 ]
0 commit comments