tests

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Tests Directory

This directory contains additional testing documentation and utilities for the ship-go project.

Contents

deadlock_test_guide.md

Comprehensive guide for understanding and running deadlock detection tests in the ship-go codebase.

Deadlock Testing

The deadlock detection tests are integrated directly into the respective packages:

  • ship/connection_deadlock_test.go - Ship connection deadlock tests
  • hub/deadlock_detection_test.go - Hub deadlock detection tests
Running 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
Manual Testing
# 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 ./...

Test Organization

Deadlock and concurrency tests are co-located with the code they test:

  • ship/ package tests are in ship/*_test.go
  • hub/ package tests are in hub/*_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

CI/CD Integration

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:

Documentation

Overview

Package tests provides integration and stress tests for the SHIP implementation. These tests are separated from the main packages to allow for comprehensive system-level testing without circular dependencies.

The stress tests use build tags to avoid running during normal test cycles:

go test -tags=stress ./tests

For more information, see the README.md in this directory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL