This directory contains additional testing documentation and utilities for the ship-go project.
Comprehensive guide for understanding and running deadlock detection tests in the ship-go codebase.
The deadlock detection tests are integrated directly into the respective packages:
ship/connection_deadlock_test.go- Ship connection deadlock testshub/deadlock_detection_test.go- Hub deadlock detection tests
Use the Makefile targets for convenient testing:
# Quick deadlock tests
make test-deadlock-specific
# All deadlock tests
make test-deadlock
# Full concurrency test suite
make test-concurrency# Ship deadlock tests
go test -race -tags=deadlock -timeout=30s ./ship
# Hub deadlock tests
go test -race -tags=deadlock -timeout=30s ./hub
# Stress tests
go test -race -tags=stress -timeout=60s ./...Deadlock and concurrency tests are co-located with the code they test:
ship/package tests are inship/*_test.gohub/package tests are inhub/*_test.go- Shared utilities are in
internal/testing/testhelper/
This organization ensures:
- Tests have access to internal methods and types
- Tests are maintained alongside the code they verify
- No complex import dependencies between test packages
The deadlock tests are automatically run in GitHub Actions:
- Every push/PR: Basic deadlock detection tests
- Concurrency changes: Enhanced testing with multiple core counts
- Nightly: Full stress testing and performance monitoring
See the concurrency guides for more details: