diff --git a/tests/smoketests/sdk/test_async_devbox.py b/tests/smoketests/sdk/test_async_devbox.py index 860502cd7..cbfc5c030 100644 --- a/tests/smoketests/sdk/test_async_devbox.py +++ b/tests/smoketests/sdk/test_async_devbox.py @@ -438,15 +438,20 @@ async def test_create_ssh_key(self, async_sdk_client: AsyncRunloopSDK) -> None: await devbox.shutdown() @pytest.mark.timeout(TWO_MINUTE_TIMEOUT) - async def test_create_and_remove_tunnel(self, async_sdk_client: AsyncRunloopSDK) -> None: - """Test creating and removing a tunnel.""" + async def test_create_tunnel_deprecated(self, async_sdk_client: AsyncRunloopSDK) -> None: + """Test creating a tunnel (deprecated - now creates v2 tunnel). + + Note: The deprecated create_tunnel endpoint now creates v2 Portal tunnels + which cannot be removed. They remain active until the devbox is stopped. + Use enable_tunnel for creating v2 tunnels instead. + """ devbox = await async_sdk_client.devbox.create( name=unique_name("sdk-async-devbox-tunnel"), launch_parameters={"resource_size_request": "SMALL", "keep_alive_time_seconds": 60 * 5}, ) try: - # Create tunnel + # Create tunnel (now creates v2 Portal tunnel) with pytest.warns(DeprecationWarning, match="create_tunnel is deprecated"): tunnel = await devbox.net.create_tunnel(port=8080) assert tunnel is not None @@ -454,9 +459,10 @@ async def test_create_and_remove_tunnel(self, async_sdk_client: AsyncRunloopSDK) assert tunnel.port == 8080 assert tunnel.devbox_id == devbox.id - # Remove tunnel - with pytest.warns(DeprecationWarning, match="remove_tunnel is deprecated"): - await devbox.net.remove_tunnel(port=8080) + # Verify tunnel persists in devbox info (v2 tunnels cannot be removed) + info = await devbox.get_info() + assert info.tunnel is not None + assert info.tunnel.tunnel_key is not None finally: await devbox.shutdown() diff --git a/tests/smoketests/sdk/test_devbox.py b/tests/smoketests/sdk/test_devbox.py index 196fb312e..38e885f71 100644 --- a/tests/smoketests/sdk/test_devbox.py +++ b/tests/smoketests/sdk/test_devbox.py @@ -435,15 +435,20 @@ def test_create_ssh_key(self, sdk_client: RunloopSDK) -> None: devbox.shutdown() @pytest.mark.timeout(TWO_MINUTE_TIMEOUT) - def test_create_and_remove_tunnel(self, sdk_client: RunloopSDK) -> None: - """Test creating and removing a tunnel.""" + def test_create_tunnel_deprecated(self, sdk_client: RunloopSDK) -> None: + """Test creating a tunnel (deprecated - now creates v2 tunnel). + + Note: The deprecated create_tunnel endpoint now creates v2 Portal tunnels + which cannot be removed. They remain active until the devbox is stopped. + Use enable_tunnel for creating v2 tunnels instead. + """ devbox = sdk_client.devbox.create( name=unique_name("sdk-devbox-tunnel"), launch_parameters={"resource_size_request": "SMALL", "keep_alive_time_seconds": 60 * 5}, ) try: - # Create tunnel + # Create tunnel (now creates v2 Portal tunnel) with pytest.warns(DeprecationWarning, match="create_tunnel is deprecated"): tunnel = devbox.net.create_tunnel(port=8080) assert tunnel is not None @@ -451,9 +456,10 @@ def test_create_and_remove_tunnel(self, sdk_client: RunloopSDK) -> None: assert tunnel.port == 8080 assert tunnel.devbox_id == devbox.id - # Remove tunnel - with pytest.warns(DeprecationWarning, match="remove_tunnel is deprecated"): - devbox.net.remove_tunnel(port=8080) + # Verify tunnel persists in devbox info (v2 tunnels cannot be removed) + info = devbox.get_info() + assert info.tunnel is not None + assert info.tunnel.tunnel_key is not None finally: devbox.shutdown()