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

MPP-3815: Fix email processing tests #4706

Merged
merged 2 commits into from
May 13, 2024

Conversation

jwhitlock
Copy link
Member

These are a couple of test improvements suggested by @groovecoder's review of PR #4702:

  • Change test_ses_slow to actually test slow email processing
  • Change the mocked future.wait(1.0) call to not increment the timer, and instead delegate to the time.monotonic call in the same loop, so the loop takes the expected 1 simulated second instead of 2 simulated seconds.

@@ -30,7 +30,7 @@


@pytest.fixture(autouse=True)
def mocked_clocks() -> Iterator[Callable[[float], float]]:
def mocked_clocks() -> Iterator[None]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you somehow resisted the dark urge to rename this mlocks again.

@@ -447,7 +446,8 @@ def test_ses_slow(
assert rec2_extra["success"] is True
assert rec2_extra["message_process_time_s"] < 120.0
assert rec2_extra["subprocess_setup_time_s"] == 1.0
assert mock_process_pool_future._timeouts == [1.0]
# future.wait(1.0) was called 3 times, was ready after the 3rd call.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: nice comment. now I see how this correlates to the 3-item _is_stalled.side_effect list.

@jwhitlock jwhitlock added this pull request to the merge queue May 13, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 13, 2024
Merged via the queue into main with commit 19c162a May 13, 2024
28 checks passed
@jwhitlock jwhitlock deleted the fix-email-processing-tests-mpp-3815 branch May 13, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants