|
| 1 | +# Driver Engine Static Test Order |
| 2 | + |
| 3 | +This note breaks the `driver-engine.test.ts` suite into file-name groups for static-only debugging. |
| 4 | + |
| 5 | +Scope: |
| 6 | +- `registry (static)` only |
| 7 | +- `client type (http)` only unless a specific bug points to inline client behavior |
| 8 | +- `encoding (bare)` only unless a specific bug points to CBOR or JSON |
| 9 | +- Exclude `agent-os` from the normal pass target |
| 10 | +- Exclude `dynamic-reload` from the static pass target |
| 11 | + |
| 12 | +Checklist rules: |
| 13 | +- A checkbox is marked only when the entire `*.ts` file has been covered and is fully passing. |
| 14 | +- Do not check a file off just because investigation started. |
| 15 | +- Start with a single test name, not a whole file-group or suite label. |
| 16 | +- After one single test passes, grow scope within that same file until the entire file passes. |
| 17 | +- Do not start the next tracked file until the current file is fully passing. |
| 18 | +- If a widened file run fails, stop expanding scope and fix that same file before running anything from the next file. |
| 19 | +- Record average duration only after the full file is passing. |
| 20 | +- The filenames in this note are tracking labels only. `pnpm test ... -t` does not filter by `src/driver-test-suite/tests/<file>.ts`. |
| 21 | +- `driver-engine.test.ts` wires everything into nested `describe(...)` blocks, so filter by the description text from the suite, plus the static path text when needed: `registry (static)`, `client type (http)`, and `encoding (bare)`. |
| 22 | + |
| 23 | +## How To Filter |
| 24 | + |
| 25 | +Use `-t` against the `describe(...)` text, not the filename from this note. |
| 26 | + |
| 27 | +Base command shape: |
| 28 | + |
| 29 | +```bash |
| 30 | +cd rivetkit-typescript/packages/rivetkit |
| 31 | +pnpm test driver-engine.test.ts -t "registry \\(static\\).*client type \\(http\\).*encoding \\(bare\\).*<suite description text>" |
| 32 | +``` |
| 33 | + |
| 34 | +To narrow to one single test inside that suite, append a stable chunk of the test name: |
| 35 | + |
| 36 | +```bash |
| 37 | +cd rivetkit-typescript/packages/rivetkit |
| 38 | +pnpm test driver-engine.test.ts -t "registry \\(static\\).*client type \\(http\\).*encoding \\(bare\\).*Actor Driver Tests.*should" |
| 39 | +``` |
| 40 | + |
| 41 | +Common suite-description mappings: |
| 42 | +- `actor-state.ts` -> `Actor State Tests` |
| 43 | +- `actor-schedule.ts` -> `Actor Schedule Tests` |
| 44 | +- `actor-sleep.ts` -> `Actor Sleep Tests` |
| 45 | +- `actor-sleep-db.ts` -> `Actor Sleep Database Tests` |
| 46 | +- `actor-lifecycle.ts` -> `Actor Lifecycle Tests` |
| 47 | +- `manager-driver.ts` -> `Manager Driver Tests` |
| 48 | +- `actor-conn.ts` -> `Actor Connection Tests` |
| 49 | +- `actor-conn-state.ts` -> `Actor Connection State Tests` |
| 50 | +- `conn-error-serialization.ts` -> `Connection Error Serialization Tests` |
| 51 | +- `access-control.ts` -> `access control` |
| 52 | +- `actor-vars.ts` -> `Actor Variables` |
| 53 | +- `actor-db.ts` -> `Actor Database (raw) Tests`, `Actor Database (drizzle) Tests`, or `Actor Database Lifecycle Cleanup Tests` |
| 54 | +- `raw-http.ts` -> `raw http` |
| 55 | +- `raw-http-request-properties.ts` -> `raw http request properties` |
| 56 | +- `raw-websocket.ts` -> `raw websocket` |
| 57 | +- `hibernatable-websocket-protocol.ts` -> `hibernatable websocket protocol` |
| 58 | +- `cross-backend-vfs.ts` -> `Cross-Backend VFS Compatibility Tests` |
| 59 | +- `actor-agent-os.ts` -> `Actor agentOS Tests` |
| 60 | +- `dynamic-reload.ts` -> `Dynamic Actor Reload Tests` |
| 61 | +- `actor-conn-status.ts` -> `Connection Status Changes` |
| 62 | +- `gateway-routing.ts` -> `Gateway Routing` |
| 63 | +- `lifecycle-hooks.ts` -> `Lifecycle Hooks` |
| 64 | + |
| 65 | +Why this order: |
| 66 | +- The suite currently pays full per-test harness cost for every test: |
| 67 | + - fresh namespace |
| 68 | + - fresh runner config |
| 69 | + - fresh envoy/driver lifecycle |
| 70 | +- Cheap tests are mostly harness overhead |
| 71 | +- Slow tests are concentrated in sleep, sandbox, workflow, and DB stress categories |
| 72 | +- Wrapper suites that pull in sleep-heavy children should be treated as slow even if the wrapper filename looks generic |
| 73 | +- Files that use sleep/hibernation waits or `describe.sequential` should not stay in the fast block |
| 74 | + |
| 75 | +## Fastest First |
| 76 | + |
| 77 | +These are the best initial groups for static-only bring-up. |
| 78 | + |
| 79 | +- [x] `manager-driver.ts` - avg ~10.3s/test over 16 tests, suite 15.1s |
| 80 | +- [x] `actor-conn.ts` - avg ~8.4s/test over 23 tests, suite 16.0s |
| 81 | +- [x] `actor-conn-state.ts` - avg ~9.3s/test over 8 tests, suite 9.9s |
| 82 | +- [x] `conn-error-serialization.ts` - avg ~8.2s/test over 2 tests, suite 8.2s |
| 83 | +- [x] `actor-destroy.ts` - avg ~9.8s/test over 10 tests, suite 10.2s |
| 84 | +- [x] `request-access.ts` - avg ~9.1s/test over 4 tests, suite 9.1s |
| 85 | +- [x] `actor-handle.ts` - avg ~7.7s/test over 12 tests, suite 8.3s |
| 86 | +- [x] `action-features.ts` - avg ~8.3s/test over 11 tests, suite 8.8s |
| 87 | +- [x] `access-control.ts` - avg ~8.5s/test over 8 tests, suite 8.8s |
| 88 | +- [x] `actor-vars.ts` - avg ~8.3s/test over 5 tests, suite 8.5s |
| 89 | +- [x] `actor-metadata.ts` - avg ~8.3s/test over 6 tests, suite 8.4s |
| 90 | +- [x] `actor-onstatechange.ts` - avg ~8.3s/test over 5 tests, suite 8.3s |
| 91 | +- [x] `actor-db.ts` - avg ~9.5s/test over 28 tests, suite 27.0s |
| 92 | +- [x] `actor-workflow.ts` - avg ~9.2s/test over 19 tests, suite 11.9s |
| 93 | +- [x] `actor-error-handling.ts` - avg ~8.5s/test over 7 tests, suite 8.5s |
| 94 | +- [x] `actor-queue.ts` - avg ~9.3s/test over 25 tests, suite 17.5s |
| 95 | +- [x] `actor-inline-client.ts` - avg ~9.0s/test over 5 tests, suite 9.8s |
| 96 | +- [x] `actor-kv.ts` - avg ~8.4s/test over 3 tests, suite 8.4s |
| 97 | +- [x] `actor-stateless.ts` - avg ~8.6s/test over 6 tests, suite 9.1s |
| 98 | +- [x] `raw-http.ts` - avg ~8.6s/test over 15 tests, suite 10.1s |
| 99 | +- [x] `raw-http-request-properties.ts` - avg ~8.5s/test over 16 tests, suite 9.9s |
| 100 | +- [x] `raw-websocket.ts` - avg ~8.9s/test over 13 tests, suite 11.1s |
| 101 | +- [x] `actor-inspector.ts` - avg ~9.6s/test over 20 tests, suite 12.1s |
| 102 | +- [x] `gateway-query-url.ts` - avg ~8.3s/test over 2 tests, suite 8.3s |
| 103 | +- [x] `actor-db-kv-stats.ts` - avg ~9.0s/test over 11 tests, suite 9.9s |
| 104 | +- [x] `actor-db-pragma-migration.ts` - avg ~8.8s/test over 4 tests, suite 9.0s |
| 105 | +- [x] `actor-state-zod-coercion.ts` - avg ~8.8s/test over 3 tests, suite 8.8s |
| 106 | +- [ ] `actor-conn-status.ts` |
| 107 | +- [ ] `gateway-routing.ts` |
| 108 | +- [ ] `lifecycle-hooks.ts` |
| 109 | + |
| 110 | +## Slow End |
| 111 | + |
| 112 | +These should be last because they are the most likely to dominate wall time. |
| 113 | + |
| 114 | +- [x] `actor-state.ts` - avg ~9.0s/test over 3 tests, suite 9.1s |
| 115 | +- [x] `actor-schedule.ts` - avg ~9.9s/test over 4 tests, suite 9.9s |
| 116 | +- [ ] `actor-sleep.ts` |
| 117 | +- [ ] `actor-sleep-db.ts` |
| 118 | +- [ ] `actor-lifecycle.ts` |
| 119 | +- [ ] `actor-conn-hibernation.ts` |
| 120 | +- [ ] `actor-run.ts` |
| 121 | +- [ ] `actor-sandbox.ts` |
| 122 | +- [ ] `hibernatable-websocket-protocol.ts` |
| 123 | +- [ ] `cross-backend-vfs.ts` |
| 124 | +- [ ] `actor-db-stress.ts` |
| 125 | + |
| 126 | +## Not In Static Pass |
| 127 | + |
| 128 | +These should not block the static-only pass target. |
| 129 | + |
| 130 | +- [ ] `actor-agent-os.ts` |
| 131 | + Explicitly allowed to skip for now. |
| 132 | +- [ ] `dynamic-reload.ts` |
| 133 | + Dynamic-only path. |
| 134 | + |
| 135 | +## Files Present But Not Wired In `runDriverTests` |
| 136 | + |
| 137 | +- [ ] `raw-http-direct-registry.ts` - intentionally commented out (blocked on gateway actor queries) |
| 138 | +- [ ] `raw-websocket-direct-registry.ts` - intentionally commented out (blocked on gateway actor queries) |
| 139 | + |
| 140 | +## Suggested Static-Only Debugging Sequence |
| 141 | + |
| 142 | +Use one single test at a time with `-t`, then grow scope within the same file only after that single test passes. |
| 143 | + |
| 144 | +- [ ] Run one single test from the next unchecked file. |
| 145 | +- [ ] Fix the first failing single test before expanding scope. |
| 146 | +- [ ] After one test passes, widen to the rest of that file until the entire file passes. |
| 147 | +- [ ] Check the file off only after the entire file is passing. |
| 148 | +- [ ] After the fast block is clean, run the medium-cost block. |
| 149 | +- [ ] Run the slow-end block last. |
| 150 | +- [ ] Run `agent-os` separately only if explicitly needed. |
| 151 | + |
| 152 | +## Example Commands |
| 153 | + |
| 154 | +Run one tracked file-group by suite description: |
| 155 | + |
| 156 | +```bash |
| 157 | +cd rivetkit-typescript/packages/rivetkit |
| 158 | +pnpm test driver-engine.test.ts -t "registry \\(static\\).*client type \\(http\\).*encoding \\(bare\\).*Actor Driver Tests" |
| 159 | +``` |
| 160 | + |
| 161 | +Run one single test inside that tracked file-group: |
| 162 | + |
| 163 | +```bash |
| 164 | +cd rivetkit-typescript/packages/rivetkit |
| 165 | +pnpm test driver-engine.test.ts -t "registry \\(static\\).*client type \\(http\\).*encoding \\(bare\\).*Actor Driver Tests.*should create actors" |
| 166 | +``` |
| 167 | + |
| 168 | +Run a slow group explicitly by suite description: |
| 169 | + |
| 170 | +```bash |
| 171 | +cd rivetkit-typescript/packages/rivetkit |
| 172 | +pnpm test driver-engine.test.ts -t "registry \\(static\\).*client type \\(http\\).*encoding \\(bare\\).*Actor Sleep Database Tests" |
| 173 | +``` |
| 174 | + |
| 175 | +Run sandbox only: |
| 176 | + |
| 177 | +```bash |
| 178 | +cd rivetkit-typescript/packages/rivetkit |
| 179 | +pnpm test driver-engine.test.ts -t "registry \\(static\\).*client type \\(http\\).*encoding \\(bare\\).*Actor Sandbox Tests" |
| 180 | +``` |
| 181 | + |
| 182 | +## Evidence For Slow Ordering |
| 183 | + |
| 184 | +Observed from the current full-run log: |
| 185 | +- cheap tests like raw HTTP property checks are roughly around 1 second end-to-end including teardown |
| 186 | +- sandbox tests are about 8.5 to 8.8 seconds each |
| 187 | +- sleep and sleep-db groups show repeated alarm/sleep cycles and are consistently the longest-running categories in the log |
| 188 | +- `actor-state.ts`, `actor-schedule.ts`, `actor-sleep.ts`, `actor-sleep-db.ts`, and `actor-lifecycle.ts` are all called directly from `mod.ts` and inherit the sleep-heavy cost profile |
| 189 | +- `actor-run.ts`, `actor-conn-hibernation.ts`, and `hibernatable-websocket-protocol.ts` all spend real time in sleep or hibernation waits |
| 190 | +- the suite-wide average is inflated by the repeated harness lifecycle and these slow categories |
0 commit comments