@@ -56,8 +56,8 @@ def __init__(
56
56
):
57
57
"""Create the remote execution context
58
58
59
- The execution context will persist for the lifetime of this object.
60
59
The execution context can be a Docker container or Modal sandbox.
60
+ The execution context may not persist for the lifetime of this object.
61
61
"""
62
62
self .spec = spec
63
63
self .logger = logger
@@ -66,7 +66,7 @@ def __init__(
66
66
67
67
@abstractmethod
68
68
def exec_run_with_timeout (self , command : str ) -> tuple [str , bool , float ]:
69
- """Exec """
69
+ """Execute a test command """
70
70
raise NotImplementedError
71
71
72
72
def write_test_output (self , test_output : str , timed_out : bool ) -> None :
@@ -125,7 +125,8 @@ def exec_run_with_timeout(self, command: str) -> tuple[str, bool, float]:
125
125
# copy back report.json if there is any
126
126
report_file = Path (self .spec .repo_directory ) / "report.json"
127
127
# Run the test command inside the container to check if the file exists
128
- exit_code , test_output = self ._exec_run (f"test -e { report_file } " )
128
+ exit_code , test_output = self .container .exec_run (
129
+ f"test -e { report_file } " , demux = True )
129
130
# Check the exit code of the command
130
131
if exit_code == 0 :
131
132
copy_from_container (
@@ -134,10 +135,6 @@ def exec_run_with_timeout(self, command: str) -> tuple[str, bool, float]:
134
135
delete_file_from_container (self .container , str (report_file ))
135
136
return output
136
137
137
- def _exec_run (self , command : str ) -> tuple [int , str ]:
138
- """Exec"""
139
- return self .container .exec_run (command , demux = True )
140
-
141
138
def __exit__ (
142
139
self ,
143
140
exctype : Optional [Type [BaseException ]],
0 commit comments