test: strengthen assertions and remove timing assumptions - #337
Conversation
Test coverage comparisonThis comparison was rerun after syncing with the latest base. Before:
Each row uses the collector's package-level coverage from that assembly's own test project. TestLibrary is excluded from this table. Results are not summed across target frameworks, and no coverage filters or exclusions changed. Stronger assertions can improve regression protection without increasing coverage. Test results and limitations
Both runs used: dotnet restore --locked-mode
dotnet test -c Release --no-restore --nologo \
--collect:'XPlat Code Coverage' \
--results-directory <before-or-after-directory> --logger trxRelease build and formatting checks also passed. Raw Cobertura and TRX reports are retained locally in the audit evidence directory. |
posthog-dotnet Compliance ReportDate: 2026-09-27T14:30:53.121589+00:00 ✅ All Tests Passed!47/47 tests passed Capture Tests✅ 30/30 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
|
[Low risk] Test suite improvements and timing fixes. The PR appears safe to merge; no outstanding blocking finding or new actionable issue was identified. Reviews (2) · Last reviewed commit: "test: wait for retry timer registration ..." |
💡 Motivation and Context
Several tests passed without exercising the behavior in their names. The flag-event suppression test never evaluated a flag, the missing-evaluation-time test supplied a timestamp, and some serialization assertions checked the wrong property or only checked for a non-null result. Fixed sleeps also made concurrency and polling tests depend on scheduling.
This test-only change strengthens assertions across the core SDK, AI integration, and ASP.NET Core integration:
No production code, public API, dependency, or coverage exclusions changed. No tests were deleted. The two existing skipped cancellation tests remain unchanged. Broader product concerns found during the audit are not included in this PR.
💚 How did you test it?
bin/fmt --check, and the full solution tests after syncing withmainatb5440d7.origin/mainpassed forcb2b4bebe366b140c72d31f72af04080053e2aa4with no actionable findings.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset fileNo release is needed for this test-only change.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Pi performed the audit using read-only delegate reviews, file and shell tools, the .NET test runner, Coverlet, and the isolated autoreview helper. The parent agent applied and validated all test changes. The work stayed in a dedicated worktree, and raw logs and audit reports were kept out of the PR. No shareable session link was generated.
The review checked the relevant SDK specifications for flag tracking, definition loading, callback ordering, and AI privacy. The changes preserve existing SDK behavior rather than addressing unrelated implementation differences. Human review is required.