(self)
| 291 | self.assertEqual(manager.get_all(), []) |
| 292 | |
| 293 | def test_timeout(self): |
| 294 | if os.name == "nt": |
| 295 | # TODO(@wchargin): This could in principle work on Windows. |
| 296 | self.skipTest("Requires a POSIX shell for the stub script.") |
| 297 | tempdir = tempfile.mkdtemp() |
| 298 | pid_file = os.path.join(tempdir, "pidfile") |
| 299 | self._stub_tensorboard( |
| 300 | name="wait-a-minute", |
| 301 | program=textwrap.dedent( |
| 302 | r""" |
| 303 | #!/bin/sh |
| 304 | printf >%s '%%s' "$$" |
| 305 | printf >&2 'warn: I am tired\n' |
| 306 | sleep 60 |
| 307 | """ |
| 308 | % shlex.quote(os.path.realpath(pid_file)), |
| 309 | ).lstrip(), |
| 310 | ) |
| 311 | start_result = manager.start( |
| 312 | ["--logdir=./logs", "--port=0"], |
| 313 | timeout=datetime.timedelta(seconds=1), |
| 314 | ) |
| 315 | self.assertIsInstance(start_result, manager.StartTimedOut) |
| 316 | with open(pid_file) as infile: |
| 317 | expected_pid = int(infile.read()) |
| 318 | self.assertEqual(start_result, manager.StartTimedOut(pid=expected_pid)) |
| 319 | self.assertEqual(manager.get_all(), []) |
| 320 | |
| 321 | def test_tensorboard_binary_environment_variable(self): |
| 322 | if os.name == "nt": |
nothing calls this directly
no test coverage detected