| 463 | }; |
| 464 | |
| 465 | void test_container_mt_stop_empty() { |
| 466 | test_mt_handler th; |
| 467 | proton::container c(th); |
| 468 | c.auto_stop( false ); |
| 469 | container_runner runner(c); |
| 470 | auto t = std::thread(runner); |
| 471 | // Must ensure that thread is joined |
| 472 | try { |
| 473 | ASSERT_EQUAL("start", th.wait()); |
| 474 | c.stop(); |
| 475 | t.join(); |
| 476 | ASSERT_EQUAL("", th.error().name()); |
| 477 | } catch (const std::exception &e) { |
| 478 | std::cerr << FAIL_MSG(e.what()) << std::endl; |
| 479 | // If join hangs, let the test die by timeout. We cannot |
| 480 | // detach and continue: deleting the container while it is |
| 481 | // still alive will put the process in an undefined state. |
| 482 | t.join(); |
| 483 | throw; |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | void test_container_mt_stop() { |
| 488 | test_mt_handler th; |