Skip to content

Conversation

CaptChrisD
Copy link
Contributor

The test teardown had a race condition where the mock_socket_state process could terminate between checking its existence and attempting to stop it. This caused Agent.stop/1 to fail with "no process" errors.

Fixed by:

  • Capturing PID first to avoid TOCTOU issues
  • Checking if process is alive before stopping
  • Wrapping stop call in try/catch for graceful error handling
  • Adding timeout to prevent hanging

The test teardown had a race condition where the mock_socket_state
process could terminate between checking its existence and attempting
to stop it. This caused Agent.stop/1 to fail with "no process" errors.

Fixed by:
- Capturing PID first to avoid TOCTOU issues
- Checking if process is alive before stopping
- Wrapping stop call in try/catch for graceful error handling
- Adding timeout to prevent hanging
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