class_docstr: Tests for horovod.runner.common.service.
docstr: test non-zero exit code
docstr_tok: ["test","non-zero","exit","code"]
code: def test_exit_code(self):
      """test non-zero exit code"""
      key = secret.make_secret_key()
      service_name = "test-service"
      service = BasicTaskService(
          service_name, 0, key, nics=None, verbose=2
      )
      try:
          client = BasicTaskClient(
              service_name,
              service.addresses(),
              key,
              verbose=2,
              attempts=1,
          )
          client.run_command("false", {})
          res = client.wait_for_command_exit_code()
          self.assertEqual(1, res)
      finally:
          service.shutdown()
  
imports: import io
  import queue
  import threading
  import time
  import unittest
  import warnings
  import pytest
  from horovod.runner.common.service.task_service import BasicTaskClient, BasicTaskService
  from horovod.runner.common.util import network, secret
  from horovod.runner.util.threads import in_thread
  from horovod.runner.util.streams import Pipe
label_desc: Use image node_id 5 for calling the NetworkTests obj's underlying member method code with example usage: obj.test_exit_code() without return types