Skip to content

chore(engine): roxiproxi tests#4864

Merged
NathanFlurry merged 1 commit into
mainfrom
05-01-chore_engine_roxiproxi_tests
May 9, 2026
Merged

chore(engine): roxiproxi tests#4864
NathanFlurry merged 1 commit into
mainfrom
05-01-chore_engine_roxiproxi_tests

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@NathanFlurry NathanFlurry mentioned this pull request May 1, 2026
11 tasks
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Preview packages published to npm

Install with:

npm install rivetkit@pr-4864

All packages published as 0.0.0-pr.4864.06929ff with tag pr-4864.

Engine binary is shipped via @rivetkit/engine-cli on linux-x64-musl, linux-arm64-musl, darwin-x64, and darwin-arm64. Windows users should use the release installer or set RIVET_ENGINE_BINARY.

Docker images:

docker pull rivetdev/engine:slim-06929ff
docker pull rivetdev/engine:full-06929ff
Individual packages
npm install rivetkit@pr-4864
npm install @rivetkit/react@pr-4864
npm install @rivetkit/rivetkit-napi@pr-4864
npm install @rivetkit/workflow-engine@pr-4864

@NathanFlurry NathanFlurry force-pushed the 05-01-chore_engine_roxiproxi_tests branch from 7bbb3c9 to 5aff63c Compare May 1, 2026 11:13
@NathanFlurry NathanFlurry marked this pull request as ready for review May 1, 2026 11:14
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 1, 2026

PR #4864 Review — Network Fault Injection Tests

This PR adds network fault injection tests for the Pegboard Envoy client, verifying that the envoy WebSocket reconnects correctly after a server-side TCP reset without replaying actor start commands. The core architecture is solid, but there are two blocking bugs and several nits.


Bug: Duplicate pub mod auth; in envoy/mod.rs

engine/packages/engine/tests/envoy/mod.rs contains pub mod auth; twice. This is a compile error — one of those lines should be pub mod network_faults;:

pub mod auth;
pub mod auth;           // <-- duplicate, will fail to compile
pub mod network_faults;

Bug: on_connect / on_disconnect not wired in connection/wasm.rs

The new callbacks are fired in connection/native.rs but the WASM path (connection/wasm.rs) never calls them. This creates a parity gap — any consumer relying on connection event callbacks will get no events in a WASM build. Per the repo's convention (and CLAUDE.md), both connection paths must be kept at feature parity.


Issue: Single proxy port limits ToxiproxyTestServer to one proxy per container

ToxiproxyTestServer::proxy() always listens on the hardcoded DEFAULT_PROXY_PORT (8666). A second proxy created on the same server instance would conflict. The struct name implies multi-proxy support but the implementation doesn't support it. Either document this as a single-proxy limitation or accept a port parameter so the abstraction isn't misleading to future callers.

Nit: wait_for_admin polling loop

toxiproxy.rs uses loop { check; sleep } for the admin API readiness wait. CLAUDE.md flags this pattern, though polling a Docker container's HTTP admin endpoint is a legitimate case with no push notification available. The new wait_with_poll helper introduced in the same PR could be used here for consistency, and a brief comment explaining why event-driven isn't feasible would satisfy the codebase's own guidelines.

Nit: Ordering::SeqCst is stronger than needed

network_faults.rs uses Ordering::SeqCst for the actor start counter. Since there's no ordering relationship established between this counter and other atomics, Ordering::Relaxed is sufficient for both the increment and load.

Nit: ping_actor_via_gateway duplicates ping_actor_via_guard

The local ping_actor_via_gateway function in network_faults.rs appears nearly identical to common::ping_actor_via_guard. If the paths and semantics are equivalent, prefer the shared helper. If they differ intentionally, a comment explaining why is warranted.


Required before merge:

  1. Remove the duplicate pub mod auth; line — compile error.
  2. Add on_connect / on_disconnect to connection/wasm.rs to match native.rs.

The fault injection infrastructure (ToxiproxyTestServer, EnvoyConnectionEventWaiter, wait_with_poll) is well-designed and the test itself covers the right invariant. The nits above can be addressed as follow-up.

@MasterPtato MasterPtato force-pushed the 05-01-chore_engine_roxiproxi_tests branch from 5aff63c to 0460eb7 Compare May 9, 2026 02:24
@MasterPtato MasterPtato force-pushed the graphite-base/4864 branch from 298ede2 to 395aa83 Compare May 9, 2026 02:24
@MasterPtato MasterPtato changed the base branch from graphite-base/4864 to main May 9, 2026 02:25
@NathanFlurry NathanFlurry changed the base branch from main to graphite-base/4864 May 9, 2026 06:36
@NathanFlurry NathanFlurry force-pushed the 05-01-chore_engine_roxiproxi_tests branch from 0460eb7 to a5be52d Compare May 9, 2026 06:36
@NathanFlurry NathanFlurry changed the base branch from graphite-base/4864 to skip-ready-wait/query-gateway May 9, 2026 06:36
@NathanFlurry NathanFlurry force-pushed the 05-01-chore_engine_roxiproxi_tests branch from a5be52d to ea3cb2a Compare May 9, 2026 07:33
@NathanFlurry NathanFlurry force-pushed the skip-ready-wait/query-gateway branch from ac432a0 to d4c5d79 Compare May 9, 2026 07:33
Base automatically changed from skip-ready-wait/query-gateway to main May 9, 2026 07:50
@NathanFlurry NathanFlurry merged commit ea3cb2a into main May 9, 2026
6 of 12 checks passed
@NathanFlurry NathanFlurry deleted the 05-01-chore_engine_roxiproxi_tests branch May 9, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant