4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 10:34:29 +08:00
nerfstudio/tests/viewer/test_viewer.py
Ethan Weber 7aa6ca9948
Kill the training script if the viewer ports are conflicting with other processes (#352)
kills program if conflicting ports for the viewer
2022-09-07 12:32:31 -07:00

24 lines
744 B
Python

"""
Test communications with the viewer.
"""
import time
from nerfactory.viewer.server.subprocess import run_viewer_bridge_server_as_subprocess
def test_run_subprocess():
"""Test running the viewer bridge server as a subprocess."""
zmq_port = 6000 + 10 # don't use the default ports to avoid conflicting with current training jobs
websocket_port = 7007 + 10
print("Starting the viewer bridge server as a subprocess.")
run_viewer_bridge_server_as_subprocess(zmq_port, websocket_port, log_filename=None)
print("Started the viewer bridge server as a subprocess.")
# do something will the viewer bridge server runs
time.sleep(1)
if __name__ == "__main__":
test_run_subprocess()
print("Tests passed.")