Skip to content

Improving memory managemenet, testing and adding Justfile#1

Open
HackStrix wants to merge 5 commits intomainfrom
sn/memory_limit
Open

Improving memory managemenet, testing and adding Justfile#1
HackStrix wants to merge 5 commits intomainfrom
sn/memory_limit

Conversation

@HackStrix
Copy link
Collaborator

This pull request introduces significant improvements to testing, memory management, and developer tooling for the herd project. It adds comprehensive unit, integration, and proxy tests, implements configurable memory limits for worker processes, and provides a Justfile for streamlined development workflows. The changes enhance code reliability, test coverage, and operational safety.

Testing Enhancements:

  • Added extensive unit tests for ProcessFactory and worker behavior, covering process spawning, health checks, timeout handling, memory limits, and process cleanup (factory_test.go, worker_test.go). [1] [2]
  • Introduced integration tests to verify end-to-end pool and proxy functionality with dummy worker processes (integration_test.go).
  • Added dedicated proxy tests using a mock pool to ensure correct routing, error handling, and session management (proxy/proxy_test.go).

Memory Management:

  • Implemented WithMemoryLimit in ProcessFactory, allowing a soft virtual memory limit to be set for worker processes (enforced via ulimit on Linux, no-op on macOS/unsupported platforms). Updated process spawning logic to use a shell wrapper when memory limits are specified (factory.go, examples/ollama/main.go). [1] [2] [3] [4]

Developer Tooling:

  • Added a justfile with recipes for running tests (including race detection), linting, dependency tidying, coverage reporting, and a CI shortcut, improving developer experience and CI/CD integration.

@HackStrix HackStrix changed the title Sn/memory limit Improving memory managemenet, testing and adding Justfile Mar 8, 2026
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