44
55from algobattle .match import AlgobattleConfig , MatchConfig , RunConfig
66from algobattle .program import Generator , Solver
7+ from algobattle .util import BuildError
78
89from . import testsproblem
910from .testsproblem .problem import TestInstance , TestProblem , TestSolution
@@ -30,6 +31,17 @@ def setUpClass(cls) -> None:
3031 ).as_prog_config ()
3132 cls .instance = TestInstance (semantics = True )
3233
34+ async def test_build_error (self ):
35+ """A container's build step times out."""
36+ with self .assertRaises (BuildError , msg = "Build did not complete successfully." ):
37+ await Generator .build (path = self .problem_path / "build_error" , problem = TestProblem , config = self .config )
38+
39+ async def test_build_timeout (self ):
40+ """A container's build step times out."""
41+ config = AlgobattleConfig (match = MatchConfig (problem = "Test Problem" , build_timeout = 1.5 )).as_prog_config ()
42+ with self .assertRaises (BuildError , msg = "Build ran into a timeout." ):
43+ await Generator .build (path = self .problem_path / "build_timeout" , problem = TestProblem , config = config )
44+
3345 async def test_gen_lax_timeout (self ):
3446 """The generator times out but still outputs a valid instance."""
3547 with await Generator .build (
0 commit comments