Skip to content

Commit f85191f

Browse files
committed
Add patch to deal with CI presubmit errors
1 parent d41f76b commit f85191f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sdks/python/apache_beam/runners/worker/statesampler_test.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import logging
2222
import time
2323
import unittest
24-
from unittest.mock import Mock
24+
from unittest.mock import Mock, patch
2525

2626
from tenacity import retry
2727
from tenacity import stop_after_attempt
@@ -185,7 +185,8 @@ def test_process_timers_metric_is_recorded(self):
185185
expected_value * (1.0 + margin_of_error),
186186
"The timer metric was higher than expected.")
187187

188-
def test_do_operation_process_timer_metric(self):
188+
@patch('apache_beam.runners.common.DoFnRunner')
189+
def test_do_operation_process_timer_metric(self, mock_dofn_runner):
189190
"""
190191
Tests that the 'process-timers-msecs' metric is correctly recorded
191192
when a timer is processed within a DoOperation.
@@ -256,7 +257,8 @@ def mock_process_user_timer(*args, **kwargs):
256257
expected_value * (1.0 + margin_of_error),
257258
"The timer metric was higher than expected.")
258259

259-
def test_do_operation_process_timer_metric_with_exception(self):
260+
@patch('apache_beam.runners.common.DoFnRunner')
261+
def test_do_operation_process_timer_metric_with_exception(self, mock_dofn_runner):
260262
"""
261263
Tests that the 'process-timers-msecs' metric is still recorded
262264
when a timer callback in a DoOperation raises an exception.

0 commit comments

Comments
 (0)