Skip to content

test: keep the concurrent-session entry inside the 30-day state TTL - #112

Merged
hassiebp merged 1 commit into
mainfrom
hassiebbot/fix-state-ttl-test-b235
Oct 26, 2026
Merged

hassiebp merged 1 commit into
mainfrom
hassiebbot/fix-state-ttl-test-b235

Conversation

@hassiebp

Copy link
Copy Markdown
Collaborator

tests/integration/test_state_lock_contention.py::test_entry_of_another_session_survives_the_emit has been failing on main and on every PR since 2026-10-10, whatever the change under test.

The test saved another session's state entry with the fixed date 2026-09-10. save_hook_state in hooks/langfuse_hook.py drops entries older than 30 days, so the entry was pruned before the assertion ran. The test now stamps the entry with the current time.

This is the only test failure on #108, so its CI should go green once this merges and it is re-run.

Verification

  • uv run --group dev pytest: 279 passed (unmodified main: 1 failed, 278 passed)
  • uvx ruff check --select F,E9 .: All checks passed!
Open in Web Open in Cursor 

The test saved the other session's entry with a fixed date. save_hook_state
drops entries older than 30 days, so from 2026-10-10 the entry was pruned
and the test failed regardless of the change under test. Stamp it with the
current time instead.

Co-authored-by: hassieb.pakzad <hassieb.pakzad@clickhouse.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T16:31:50.987216Z 050e27d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM. This is a one-line test fix that stops a hardcoded date from aging past the state TTL.

What was reviewed:

  • save_hook_state in hooks/langfuse_hook.py (around line 601) drops entries older than 30 days. A 2026-09-10 stamp would have been pruned before the assertion ran, so stamping the entry with the current UTC time fixes the failure.
  • datetime and timezone are already imported on line 6, so no new import is needed. The new value uses the same format as the file's existing helper on line 14.
Extended reasoning...

The change touches one line in tests/integration/test_state_lock_contention.py: a test fixture's timestamp goes from a fixed date to the current UTC time. No production code changes, and there is no security-sensitive surface. The diff matches the 30-day cutoff in hooks/langfuse_hook.py, which explains why the old fixed date began failing. No CODEOWNERS file covers the path, and the PR timeline has no reviewer objections.

@hassiebp
hassiebp merged commit 6fb3bde into main Oct 26, 2026
7 checks passed
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