File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99# pyre-strict
1010
1111
12+ import os
1213import time
1314import unittest
1415from typing import Callable , Generator , Tuple
@@ -1195,11 +1196,21 @@ def get_trained_qr_dqn_agent_and_environment(
11951196 """
11961197
11971198 def test_construction_of_all_types (self ) -> None :
1199+ # The offline agents (IQL and CQL) fetch their training datasets from an
1200+ # external URL, unreachable under network isolation (e.g. network_access=none).
1201+ # Detect isolation via the local-forkserver env var or the RE marker file,
1202+ # mirroring RemoteExecutionEnv::isInsideReNetworkIsolation().
1203+ network_isolated = os .environ .get (
1204+ "INSIDE_NETWORK_ISOLATION"
1205+ ) is not None or os .path .exists ("/run/re_worker/net_isolation" )
11981206 for (
11991207 agent_type ,
12001208 _new_agent_function ,
12011209 trained_agent_function ,
12021210 ) in self .get_agent_makers ():
1211+ if network_isolated and "offline" in agent_type :
1212+ print (f"Skipping construction of { agent_type } (requires network)" )
1213+ continue
12031214 print (f"Testing construction of { agent_type } " )
12041215 start = time .time ()
12051216 trained_agent_function ()
You can’t perform that action at this time.
0 commit comments