Skip to content

fix(tests): poll for logs in smoke tests to handle CloudWatch ingestion latency#774

Merged
sid-rl merged 2 commits intomainfrom
siddarth/logs-flake
Mar 31, 2026
Merged

fix(tests): poll for logs in smoke tests to handle CloudWatch ingestion latency#774
sid-rl merged 2 commits intomainfrom
siddarth/logs-flake

Conversation

@sid-rl
Copy link
Copy Markdown
Contributor

@sid-rl sid-rl commented Mar 31, 2026

Poll for logs in smoke tests to handle CloudWatch ingestion latency. Consolidates test_logs_basic into test_logs_with_execution_filter since the basic test adds no coverage beyond the filtered variant.

@sid-rl sid-rl changed the base branch from fix/axon-list-sdk-params to main March 31, 2026 22:21
@sid-rl sid-rl force-pushed the siddarth/logs-flake branch from 186ac63 to 35154c3 Compare March 31, 2026 22:24
@sid-rl sid-rl requested review from james-rl and jrvb-rl March 31, 2026 23:10
Copy link
Copy Markdown
Contributor

@jrvb-rl jrvb-rl left a comment

Choose a reason for hiding this comment

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

main changes here look reasonable. I'm curious about why you are removing some of these existing test, though.

Also, can you add a note to the first polling occurrence in each test file describing what polling behavior we think is needed? (eg, why 10x 1s polls instead of something else?). We don't need this every occurrence, but having this knowledge semi-discoverable is probably handy.

Comment on lines -1043 to -1056
@pytest.mark.timeout(THIRTY_SECOND_TIMEOUT)
async def test_logs_basic(self, shared_devbox: AsyncDevbox) -> None:
"""Test retrieving devbox logs returns valid response structure."""
test_message = "async basic log test message"
result = await shared_devbox.cmd.exec(f'echo "{test_message}"')
assert result.exit_code == 0

logs = await shared_devbox.logs()

assert logs is not None
assert hasattr(logs, "logs")
assert isinstance(logs.logs, list)
log_content = " ".join(str(log) for log in logs.logs)
assert test_message in log_content
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is testing a slightly different path (filter by execution ID or no...) Is there a reason you got rid of this one?

Comment on lines -1029 to -1031
@pytest.mark.timeout(THIRTY_SECOND_TIMEOUT)
def test_logs_basic(self, shared_devbox: Devbox) -> None:
"""Test retrieving devbox logs returns valid response structure."""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why remove this one?

@sid-rl sid-rl merged commit 5f1e187 into main Mar 31, 2026
7 checks passed
@sid-rl sid-rl deleted the siddarth/logs-flake branch March 31, 2026 23:50
@stainless-app stainless-app bot mentioned this pull request Mar 31, 2026
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