Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try deflaking test timing #32351

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions sdks/python/apache_beam/ml/inference/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,13 +887,12 @@ def test_run_inference_timeout_not_hit(self):
def test_run_inference_timeout_does_garbage_collection(self):
with tempfile.TemporaryDirectory() as tmp_dirname:
tmp_path = os.path.join(tmp_dirname, 'tmp_filename')
expected_file_contents = 'Deleted FakeSlowModel'
with TestPipeline() as pipeline:
# Start with bad example which gets timed out.
# Then provide plenty of time for GC to happen.
examples = [20] + [1] * 15
examples = [20] + [1] * 15 + [20, 20, 20]
expected_good = [1] * 15
expected_bad = [20]
expected_bad = [20, 20, 20, 20]
pcoll = pipeline | 'start' >> beam.Create(examples)
main, other = pcoll | base.RunInference(
FakeSlowModelHandler(
Expand All @@ -910,7 +909,7 @@ def test_run_inference_timeout_does_garbage_collection(self):

with open(tmp_path) as f:
s = f.read()
self.assertEqual(s, expected_file_contents)
self.assertNotEqual(s, '')

def test_run_inference_impl_inference_args(self):
with TestPipeline() as pipeline:
Expand Down
Loading