Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1efa877

Browse files
committed
More test fixes
1 parent 7f52afa commit 1efa877

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

sdks/python/apache_beam/io/gcp/bigquery_file_loads_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ def test_records_traverse_transform_with_mocks(self):
447447
validate=False,
448448
temp_file_format=bigquery_tools.FileFormat.JSON)
449449

450-
# Need to test this with the DirectRunner to avoid serializing mocks
451-
with TestPipeline('DirectRunner') as p:
450+
# Need to test this with the FnApiRunner to avoid serializing mocks
451+
with TestPipeline('FnApiRunner') as p:
452452
outputs = p | beam.Create(_ELEMENTS) | transform
453453

454454
dest_files = outputs[bqfl.BigQueryBatchFileLoads.DESTINATION_FILE_PAIRS]

sdks/python/apache_beam/ml/ts/util_test.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ class PeriodicStreamTest(unittest.TestCase):
3131
def test_interval(self):
3232
options = PipelineOptions()
3333
start = Timestamp.now()
34-
with beam.Pipeline(options=options) as p:
34+
# TODO(https://github.com/apache/beam/issues/34549): This test makes bad
35+
# assumptions about time and should be fixed. Context:
36+
# https://github.com/apache/beam/pull/35300#issuecomment-2997517699
37+
with beam.Pipeline('FnApiRunner', options=options) as p:
3538
ret = (
3639
p | PeriodicStream([1, 2, 3, 4], interval=0.5)
3740
| beam.WindowInto(FixedWindows(0.5))
@@ -46,7 +49,10 @@ def test_interval(self):
4649
def test_repeat(self):
4750
options = PipelineOptions()
4851
start = Timestamp.now()
49-
with beam.Pipeline(options=options) as p:
52+
# TODO(https://github.com/apache/beam/issues/34549): This test makes bad
53+
# assumptions about time and should be fixed. Context:
54+
# https://github.com/apache/beam/pull/35300#issuecomment-2997517699
55+
with beam.Pipeline('FnApiRunner', options=options) as p:
5056
ret = (
5157
p | PeriodicStream(
5258
[1, 2, 3, 4], interval=0.5, max_duration=3, repeat=True)
@@ -62,7 +68,10 @@ def test_repeat(self):
6268
def test_timestamped_value(self):
6369
options = PipelineOptions()
6470
start = Timestamp.now()
65-
with beam.Pipeline(options=options) as p:
71+
# TODO(https://github.com/apache/beam/issues/34549): This test makes bad
72+
# assumptions about time and should be fixed. Context:
73+
# https://github.com/apache/beam/pull/35300#issuecomment-2997517699
74+
with beam.Pipeline('FnApiRunner', options=options) as p:
6675
ret = (
6776
p | PeriodicStream([(Timestamp(1), 1), (Timestamp(3), 2),
6877
(Timestamp(2), 3), (Timestamp(1), 4)],

0 commit comments

Comments
 (0)