Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: always kill warnet server #141

Closed
wants to merge 1 commit into from

Conversation

willcl-ark
Copy link
Contributor

Currently, if a test fails warnet server might not be properly killed and so remain running.

This is annoying for iteration; if the test fails we want everything gone ready to run again.

Also only try to bring the network down if we first brought it up.

@vercel
Copy link

vercel bot commented Oct 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
warnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 12, 2023 0:06am

test/test_base.py Show resolved Hide resolved
test/test_base.py Outdated Show resolved Hide resolved
@willcl-ark
Copy link
Contributor Author

@pinheadmz FYI all tests passing now (just restarted to pass).

I also covered both startup CLI/RPC commands, i.e. start, and up for CLi , and from_network and up for RPC.

Currently, if a test fails warnet server might not be properly killed
and so remain running.

This is annoying for iteration; if the test fails we want everything
gone ready to run again.

Also only try to bring the network down if we first brought it up to
avoid spurious error messages in the logs.
# kill the server process by its PID if it still survives
if self.server:
print(f"killing server with pid {self.server.pid}")
os.killpg(os.getpgid(self.server.pid), signal.SIGTERM)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks to me like the most useful part of this PR, I dont really understand the need for the other changes. Why couldn't this emergency termination just be part of the original cleanup() in the exception handler (i.e. if warcli stop fails?)

@willcl-ark willcl-ark closed this Oct 24, 2023
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.

2 participants