Skip to content

test: complete v0.12.0 bug hunt regression test coverage#36

Merged
jeong-sik merged 2 commits intomainfrom
bugfix/v0120-test-coverage
Mar 17, 2026
Merged

test: complete v0.12.0 bug hunt regression test coverage#36
jeong-sik merged 2 commits intomainfrom
bugfix/v0120-test-coverage

Conversation

@jeong-sik
Copy link
Owner

Summary

  • v0.12.0 bug hunt report에서 테스트가 누락된 5개 항목(C4, H1, H2, L1, M1)에 대해 12개 회귀 테스트 추가
  • test_bug_fixes.ml 테스트 케이스: 22 → 34개

Added Tests

Bug ID Description Tests
C4 ensure_rng Tls_helpers 통합 검증 1
H1 Session 상태 머신 전이 (이중 초기화 거부, ready 가드, close) 3
H2 미지원 버전 → latest fallback + 정상 버전 협상 2
L1 default_max_response_size 상수 검증 1
M1 pre-init 세션 검증 (any accept) + post-init 헤더 매칭 2

Not Tested (by design)

Bug ID Reason
C3 Documentation-only fix (single-domain constraint)
H5 Structural refactor (tested by existing http_server integration tests)
M2 Documented design choice (snapshot via mutex use_ro)

Test plan

  • dune build --root . passes
  • dune runtest --root . passes (34/34 in Bug_fixes suite)
  • All other test suites unaffected

🤖 Generated with Claude Code

jeong-sik and others added 2 commits March 17, 2026 15:13
…L1, M1)

Cover 7 previously untested bug fixes with 12 new test cases:
- C4: ensure_rng consolidation via Tls_helpers
- H1: session state machine transitions (double init, ready guard, close)
- H2: version negotiation fallback to latest on unsupported version
- L1: default_max_response_size constant verification
- M1: pre-init session validation accepts any header

Total: 22 -> 34 test cases in test_bug_fixes.ml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…current HTTP requests

handler.ml subscribed_uris was a plain mutable field. When two concurrent
HTTP requests (subscribe + subscribe) raced on the same Handler.t, the
read-modify-write sequence could lose one update (fiber A reads old set,
fiber B reads old set, last writer wins).

Replace mutable StringSet.t with StringSet.t Atomic.t and a lock-free
compare-and-set loop. StringSet is immutable so CAS swaps a pointer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeong-sik jeong-sik marked this pull request as ready for review March 17, 2026 08:42
@jeong-sik jeong-sik merged commit f842dc7 into main Mar 17, 2026
6 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af83921a9a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

completion_handler: completion_handler option;
task_handlers: task_handlers option;
mutable subscribed_uris: StringSet.t;
subscribed_uris: StringSet.t Atomic.t;

Choose a reason for hiding this comment

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

P2 Badge Preserve independent subscription state per handler copy

Switching subscribed_uris to StringSet.t Atomic.t makes every record copy created via { s with ... } (for example through add_tool/add_resource/add_prompt) share the same mutable cell, whereas previously each copy had its own mutable field value. This means branching from a base handler into multiple handlers/servers will now leak resources/subscribe and resources/unsubscribe state across instances, so one instance’s subscriptions can unexpectedly affect another’s behavior.

Useful? React with 👍 / 👎.

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.

1 participant