test(rivetkit): re-enable gateway URL and direct-registry coverage#4659
Conversation
ecf268c to
4c4e267
Compare
ccc38b5 to
8293235
Compare
|
PR Review (updated): test(rivetkit): re-enable gateway URL and direct-registry coverage This is an updated review reflecting the latest changes. Summary This PR re-enables two test suites (raw-http-direct-registry and raw-websocket-direct-registry), rewrites driver-engine-ping.test.ts to use the serverless runner pattern, adds a waitForClientWarmup readiness barrier, adds retry logic to refreshRunnerMetadata, re-enables the dynamic registry test variant, and switches engine driver tests to describe.sequential. Significant: Silent swallow of refreshRunnerMetadata errors In driver-engine.test.ts (~line 196), all errors from refreshRunnerMetadata are caught and discarded. A permanent failure (wrong token, misconfigured endpoint) will be invisible and any downstream test failure will be misattributed. Consider logging the caught error at warn level so the CI trace retains a breadcrumb without blocking setup. Significant: Non-null assertion on serverlessHandleStart In src/test/mod.ts (~line 168) and driver-engine-ping.test.ts, the call actorDriver.serverlessHandleStart!(ctx) will throw an unhelpful TypeError if the driver does not implement this method. A guard returning HTTP 501 with a clear message would make failures immediately actionable. Moderate: Duplicated helpers across test files refreshRunnerMetadata and closeNodeServer appear in src/test/mod.ts, driver-engine.test.ts, and driver-engine-ping.test.ts. waitForOpen appears in driver-engine-ping.test.ts and raw-websocket-direct-registry.ts with differing listener cleanup quality (ping file properly cleans up; WebSocket file uses once:true without cleaning the other paths). buildGatewayRequestUrl appears in raw-http-direct-registry.ts and driver-engine-ping.test.ts with differing double-prefix guards. These should be consolidated into a shared tests/engine-test-utils.ts. Moderate: serverless config block duplicated verbatim The serverless runner config block is duplicated between src/test/mod.ts (~line 185) and driver-engine-ping.test.ts (~line 1665). Extracting it into a shared constant prevents the copies from diverging silently. Minor: waitForClientWarmup uses a fixed key across parallel tests The constant key driver-test-warmup works today because each test has its own namespace/pool, but a per-test ID would make isolation explicit and robust against future config changes. Minor: Retry sleep uses raw setTimeout instead of antiox Per CLAUDE.md, antiox is the preferred TypeScript concurrency primitive. The retry loops in refreshRunnerMetadata use raw setTimeout directly. Minor: Missing conn_params test in the HTTP gateway suite raw-http-direct-registry.ts does not include a conn_params test (the old code had one via HEADER_CONN_PARAMS). The WebSocket suite does test conn params. If the HTTP gateway path supports conn_params, this coverage gap should be tracked. Positive Observations
Review generated by Claude Sonnet 4.6 |
PR Review:
|
8293235 to
eeabed8
Compare
4c4e267 to
e823f78
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: