test(ios): cover purge restore timeout, commit and reset orderings - #647
Conversation
Compile the production startup, restore, commit and reset methods in a Foundation-only native host. Use semaphore-controlled GCD workers to cover late commits, commits whose completion signal is delayed, and both reset lock orders without sleeps or network traffic. Add sanitizer-enabled macOS CI and three generated-only negative controls that prove the corresponding regressions fail their specific assertions. No production runtime code or public API changes.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe pull request adds a host-based Objective-C++ suite for purge-restore ordering tests. It extracts selected production code, checks five ordering cases, and supports sanitizer and regression-mutation runs in a macOS workflow. ChangesPurge-Restore Test Suite
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Other Merge Risk: ⚪ Minimal · up to The added regression tests and CI checks are mergeable after normal checks; no concrete issue requiring a pre-merge fix was identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 15.79% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 3 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Keep ordinary compiler warnings visible without a blanket -Werror for extracted product code. Retain objc-method-access as a targeted test-host contract check. Replace the NSUserDefaults subclass with an NSObject-backed in-memory collaborator and substitute the defaults type only in the test translation unit. Unsupported typed selectors fail compilation; dynamic sends fail fast instead of reaching inherited real preferences or being swallowed by product exception handlers. Add instance-isolation, warning-tolerance, and unsupported read/write compile/runtime probes. Keep the five ordering cases and three regression mutants unchanged. Document the harness contracts; no production changes.
|
已在 ebfa1c2 修正这两项测试基础设施问题。 1. 不再把普通产品代码警告升级为测试失败移除全局 2. TestDefaults 不再继承 NSUserDefaults改为 仅在测试 translation unit 中、Foundation 导入后进行 新增实例隔离/快照独立性检查,以及未覆盖读写访问器的编译期、运行期反向验证。 验证已经读取 macOS CI 的成功日志,运行
上述原生测试启用 ASan/UBSan。本次只改测试脚本、测试宿主与说明文档,没有修改生产代码;这里确认的是该原生 job,不代表其他仍在执行的工作流已全部通过。 |
Summary
Follow-up to #646: turn the three suggested timing regressions into deterministic native tests. This PR changes tests and CI only; it does not change production activation policy or public APIs.
Coverage
late_commitpurgeRestorecommit_before_signalreset_winscommit_winscomplete_in_timeImplementation
RCTPushy.mmmethod/helper/global definitions at build time and compile them with the realstate_core.cpp. Generated implementation copies are not checked in. The extractor rejects missing or ambiguous definitions and preserves source locations.os_unfair_lock.testworkflow.Validation
Verified native job for head
e72197353e55cedca5eb929e9adfa6ab522822c8: Native purge-restore ordering — successful run and logs.Run on macOS:
The editing environment is Linux; native execution was validated through the actual macOS CI job above, not claimed as a local run. See
scripts/tests/ios-purge-restore/README.mdfor individual case commands, test seams and limitations. These are orchestration regression tests, not a replacement for tvOS device E2E, NSURLSession behavior, cache-purge or download/diff validation.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Tests
Documentation