| Crates.io | pawdist |
| lib.rs | pawdist |
| version | 0.1.1 |
| created_at | 2025-09-11 06:00:28.173672+00 |
| updated_at | 2025-09-11 06:29:49.88094+00 |
| description | Dynamic test distribution system that solves Playwright's static sharding imbalances |
| homepage | https://github.com/muhendiskedibey/pawdist |
| repository | https://github.com/muhendiskedibey/pawdist |
| max_upload_size | |
| id | 1833377 |
| size | 120,047 |
Pawdist is a high-performance, Rust-based dynamic test distribution system for Playwright that eliminates test duration imbalances caused by Playwright's standard static sharding (--shard) mechanism.
Playwright's built-in sharding mechanism pre-assigns tests to workers, which can lead to:
Pawdist implements a proven Manager-Worker architecture where:
pawdist-manager): Central control point that scans tests, maintains a work queue, and dynamically distributes tests to workerspawdist-worker): Execute tests and continuously request new work from the manager as they complete tasks✅ Dynamic Load Balancing - Tests are assigned on-demand as workers become available
✅ Optimal Resource Utilization - No idle workers waiting for pre-assigned shards to complete
✅ Faster Overall Execution - Tests finish when the last test completes, not when the slowest shard finishes
✅ Scalable Architecture - Easy to add/remove workers without reconfiguring test distribution
✅ Automatic Shutdown - Manager shuts down automatically when all tests complete and workers finish
cargo install pawdist
git clone https://github.com/muhendiskedibey/pawdist.git
cd pawdist
cargo build --release
The binaries will be available at:
target/release/pawdist-managertarget/release/pawdist-worker# Start with default settings (current directory, chromium browser)
pawdist-manager
# Or specify custom path and browser
pawdist-manager --playwright-project-dir /path/to/your/playwright/project --project firefox
--playwright-project-dir <PATH> (Optional, default: current directory) - Path to your Playwright project directory--project <NAME> (Optional, default: chromium) - Playwright project name (e.g., chromium, firefox, webkit)--port <PORT> (Optional, default: 50051) - gRPC server port--host <HOST> (Optional, default: 127.0.0.1) - Host to bind the gRPC serverStart one or more workers (can be on the same machine or different machines):
pawdist-worker --browser webkit --parallelism 4
--manager-address <HOST:PORT> (Optional, default: http://127.0.0.1:50051) - Manager gRPC address--parallelism <NUMBER> (Optional, default: CPU cores / 2) - Number of parallel test runners per worker--browser <TYPE> (Optional, default: chromium) - Browser type: chromium, firefox, or webkit# Terminal 1: Start the manager (uses current directory and chromium by default)
pawdist-manager
# Terminal 2: Start worker 1
pawdist-worker --browser chromium --parallelism 2
# Terminal 3: Start worker 2 (optional, for more parallelism)
pawdist-worker --browser chromium --parallelism 4 --manager-address http://127.0.0.1:50051
Manager Initialization
npx playwright test --list --project <name>Worker Registration
Dynamic Test Environment Setup
parallelism number of persistent browser serversDynamic Test Execution Loop
Automatic Completion & Cleanup
pawdist/
├── Cargo.toml # Rust project configuration
├── build.rs # gRPC code generation
├── proto/
│ └── pawdist.proto # gRPC service definitions
└── src/
├── main.rs # CLI entry point
├── manager.rs # Manager implementation
├── worker.rs # Worker implementation
└── protocol/ # Generated gRPC code
└── pawdist.rs
The communication protocol includes:
RegisterWorker - Worker registration and configuration exchangeGetNextTest - Dynamic test assignment from queueReportTestResult - Test execution result reportingNotifyWorkerShutdown - Worker notifies manager when shutting down (enables automatic manager shutdown)Workers create temporary files in the Playwright project directory:
pawdist.config.{slot}.ts - Playwright config files with WebSocket endpointspawdist.runner.{slot}.mjs - Node.js test runner scriptsAll temporary files are automatically cleaned up when workers shut down.