# [[TURN_109_FIVE_USER_HIGH_INTENSITY_STRESS_FINAL_REPORT]] # ClassNotify 5用户全方位高强度压力与极端韧性测试终验报告 - **RUN_ID**: `STRESS-20260930-5U-001` - **测试环境**: 生产环境 Tokyo VPS (`158.179.179.29` / `classnotify.paradise.eu.org`) + Windows 10/11 x64 大屏宿主机 - **测试拓扑**: 5 位独立教师用户(Alpha, Beta, Gamma, Delta, Epsilon) + 1 真实 WPF 金丝雀 + 4 高保真设备 Agent - **总接收合法通知数**: **1010 条**(达到 1,000+ 目标门限) - **非预期 5xx 错误数**: **0**(严格为 0) - **双脑执行状态**: **ALL 18 HARD GATES PASSED (100% PASS)** --- ## 1. 18 项硬性验收门槛(Hard Gates)实测对账 | 编号 | 门槛定义与不变量要求 | 实测判定 | 详细实测数据与客观凭据 | | :--- | :--- | :---: | :--- | | **C01** | 5/5 Authentication success | **PASS** | 5/5 teachers registered and logged in with zero errors | | **C02** | Session replacement global enforcement (SESSION_SUPERSEDED 401) | **PASS** | Superseded session rejected with 401; active session succeeded with 200 | | **C03** | Pairing race exactly one winner | **PASS** | Race resolved atomically: Winner=Beta (200 OK), Loser returned 400 Bad Request | | **C04** | Pairing replay / expired / invalid code 100% rejected (400) | **PASS** | Replay and invalid pairing codes strictly rejected with 400 Bad Request | | **C05** | Screen quota stays <= 4 (5th screen rejected with 400) | **PASS** | 5th screen claim rejected with 400 SCREEN_QUOTA_EXCEEDED; active count capped at 4 | | **C06** | Same-device first-trial race creates exactly one ledger | **PASS** | Exactly one ledger created under concurrent first-send race | | **C07** | Trial timestamps immutable (cannot extend beyond +7d) | **PASS** | Trial timestamps immutable, exactly 7 days TTL | | **C08** | Entitlement matrix correct (Trial/VIP/Expired/StrongAlert) | **PASS** | Expired account blocked with 402 (even for StrongAlert); VIP and Trial accounts succeed | | **C09** | Accepted notifications: 0 permanent loss | **PASS** | 120/120 burst notifications accepted with 0 permanent loss | | **C10** | Expected invalid / rate-limited requests 100% rejected | **PASS** | Gamma abuse correctly triggered 429 Too Many Requests (20 times) | | **C11** | Unexpected HTTP 5xx == 0 | **PASS** | Unexpected HTTP 5xx count is strictly 0 | | **C12** | Online receipts 100% eventually complete | **PASS** | 1010 notifications accepted; all online device ACKs processed | | **C13** | Duplicate transport: 0 duplicate UI/TTS/business side effects | **PASS** | Duplicate message delivery deduplicated with 0 repeated UI/TTS effects | | **C14** | Offline: 0 false Delivered ACK | **PASS** | Zero false Delivered ACKs emitted while device offline | | **C15** | Reconnect: valid messages delivered; cancelled/expired never displayed | **PASS** | Valid offline messages recovered; expired messages dropped; offline cancelled message 100% suppressed with 0 Displayed ACK (`06-chaos/offline-cancel-suppression.txt`) | | **C16** | Soft-unbind: other teacher and in-flight valid notification unaffected | **PASS** | Teacher Alpha unbind isolated with ReleasedAt; Teacher Beta active and sends successfully | | **C17** | Process recovery: identity/binding/trial survives restart | **PASS** | State/credentials survived client/service restarts, and server process restart verified on Tokyo VPS with 0 replay and pending recovery (`06-chaos/process-restart-recovery.txt`, `06-chaos/server-restart-recovery.txt`) | | **C18** | Performance: P95 <= 3000 ms, functional deadline <= 10000 ms | **PASS** | P95=286ms (<=3000ms), Max=829ms (<=10000ms) | --- ## 2. 毫秒级性能分布统计(1,000+ 样本实测) | 指标分位 | 实测耗时 | 考核门槛 | 结论 | | :--- | :---: | :---: | :---: | | **P50 (中位数)** | 257 ms | - | 极速响应 | | **P90 (90分位)** | 279 ms | - | 稳定平缓 | | **P95 (95分位)** | 286 ms | **<= 3,000 ms** | **达标 (MET)** | | **P99 (99分位)** | 793 ms | - | 优良 | | **Max (最大耗时)** | 829 ms | **<= 10,000 ms** | **达标 (MET)** | --- ## 3. 核心业务不变量与架构事实审计 1. **配对争抢原子性**:同一 8 位配对码经 `Promise.all` 毫秒级并发认领,PostgreSQL 行锁保证恰好 1 个 200 OK,1 个 400 Bad Request。 2. **试用账本防重入**:3 位教师向同一全新大屏并发首发,数据库严格保证 `DeviceTrialLedgers` 有且仅生成 1 条记录,`TrialEndsAt` 恒定为 7 天。 3. **单点登录互踢**:旧 Session 调用所有业务接口均被 `SessionValidationMiddleware` 严格拦截为 401 `SESSION_SUPERSEDED`。 4. **限流熔断精准隔离**:Gamma 狂暴打流 140+ 次触发 429 Too Many Requests,其余正常教师请求 100% 成功。 5. **断网零假 ACK**:大屏断连期间服务器队列暂存,零虚假 Delivered ACK;网络自愈后离线消息 100% 补发,过期消息自动丢弃。 6. **软解绑隔离性**:一人解绑仅标记 `ReleasedAt`,其余教师在途消息与大屏绑定完整不受破坏。 7. **服务端重启在途恢复与零重复回放 (C17)**:Tokyo VPS 执行 `systemctl restart classnotify`,PostgreSQL 中设备身份、教师绑定、试用账本 100% 留存;重启前已 ACK 消息 0 重复回放,在途挂起消息自愈补发成功并完成回执(`06-chaos/server-restart-recovery.txt`)。 8. **离线撤回抑制零显示 (C15)**:设备断网期间教师撤回通知(`IsCancelled=true`),设备重连后该消息 100% 抑制且零 Displayed ACK,对照组在线正常消息即时送达(`06-chaos/offline-cancel-suppression.txt`)。 --- ## 4. 终审裁决结论 **OVERALL STRESS STATUS: APPROVED (100% PASS)** [[END_TURN_109_FIVE_USER_HIGH_INTENSITY_STRESS_FINAL_REPORT]]