(with_proxy)
| 632 | @pytest.mark.skipif(not env.has_rpc(), reason="need rpc") |
| 633 | @pytest.mark.parametrize("with_proxy", (True, False)) |
| 634 | def test_rpc_session_timeout_error(with_proxy): |
| 635 | port = 9000 |
| 636 | port_end = 10000 |
| 637 | |
| 638 | tracker = Tracker(port=port, port_end=port_end) |
| 639 | time.sleep(0.5) |
| 640 | tracker_addr = (tracker.host, tracker.port) |
| 641 | |
| 642 | if with_proxy: |
| 643 | proxy = Proxy(host="0.0.0.0", port=port, port_end=port_end, tracker_addr=tracker_addr) |
| 644 | time.sleep(0.5) |
| 645 | server = rpc.Server(host=proxy.host, port=proxy.port, is_proxy=True, key="x1") |
| 646 | else: |
| 647 | server = rpc.Server(port=port, port_end=port_end, tracker_addr=tracker_addr, key="x1") |
| 648 | time.sleep(0.5) |
| 649 | |
| 650 | rpc_sess = rpc.connect_tracker(*tracker_addr).request(key="x1", session_timeout=1) |
| 651 | |
| 652 | with pytest.raises(tvm.error.RPCSessionTimeoutError): |
| 653 | f1 = rpc_sess.get_function("rpc.test.addone") |
| 654 | time.sleep(2) |
| 655 | f1(10) |
| 656 | |
| 657 | server.terminate() |
| 658 | if with_proxy: |
| 659 | proxy.terminate() |
| 660 | tracker.terminate() |
| 661 | |
| 662 | |
| 663 | @pytest.mark.parametrize("call_with_unused_argument", [True, False]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…