Unverified Commit 47826819 authored by mvdbeek's avatar mvdbeek
Browse files

Improve robustness of test_exit_code_127 k8s test

parent 895e028c
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -308,18 +308,20 @@ class BaseKubernetesIntegrationTestCase(BaseJobEnvironmentIntegrationTestCase, M
    def test_exit_code_127(self):
        inputs = {
            "failbool": True,
            "sleepsecs": 20,
            "sleepsecs": 5,
        }
        running_response = self.dataset_populator.run_tool_raw(
            "job_properties",
            inputs,
            self.history_id,
        )
        time.sleep(10)
        # check that logs are also available in job logs
        app = self._app
        sa_session = app.model.context.current
        job = sa_session.query(app.model.Job).get(app.security.decode_id(running_response.json()["jobs"][0]["id"]))
        job_id = app.security.decode_id(running_response.json()["jobs"][0]["id"])
        sa_session = app.model.context
        job = sa_session.query(app.model.Job).get(job_id)
        self._wait_for_external_state(sa_session=sa_session, job=job, expected=app.model.Job.states.RUNNING)

        external_id = job.job_runner_external_id
        output = unicodify(subprocess.check_output(["kubectl", "logs", "-l" f"job-name={external_id}"]))
        EXPECTED_STDOUT = "The bool is not true"