diff --git a/devtools/conda-envs/openmm.yaml b/devtools/conda-envs/openmm.yaml index e47dba7c8..ae4630228 100644 --- a/devtools/conda-envs/openmm.yaml +++ b/devtools/conda-envs/openmm.yaml @@ -16,7 +16,7 @@ dependencies: - py-cpuinfo - psutil - qcelemental >=0.11.1 - - pydantic >=0.30.1 + - pydantic >=1.8.2 # Testing - pytest diff --git a/devtools/conda-envs/qcore.yaml b/devtools/conda-envs/qcore.yaml index 151a52cc8..8e848bc27 100644 --- a/devtools/conda-envs/qcore.yaml +++ b/devtools/conda-envs/qcore.yaml @@ -11,7 +11,7 @@ dependencies: - py-cpuinfo - psutil - qcelemental >=0.24 - - pydantic >=0.30.1 + - pydantic >=1.8.2 - tbb<2021 # Testing diff --git a/devtools/conda-envs/xtb.yaml b/devtools/conda-envs/xtb.yaml index 974f2d020..fb710e50d 100644 --- a/devtools/conda-envs/xtb.yaml +++ b/devtools/conda-envs/xtb.yaml @@ -11,7 +11,7 @@ dependencies: - py-cpuinfo - psutil - qcelemental >=0.11.1 - - pydantic >=0.30.1 + - pydantic >=1.8.2 # Extras - gcp-correction diff --git a/qcengine/programs/psi4.py b/qcengine/programs/psi4.py index 7dd4d5e1e..99b725c64 100644 --- a/qcengine/programs/psi4.py +++ b/qcengine/programs/psi4.py @@ -108,7 +108,7 @@ def _handle_errors(self, output_data): error_message = output_data["error"]["error_message"] error_type = output_data["error"].get("error_type", "unknown_error") else: - error_message = "Unknown error, error message is not found, possibly segfaulted" + error_message = "Unknown error, error message is not found, possible segmentation fault!" error_type = "internal_error" return error_message, error_type diff --git a/qcengine/tests/test_harness_canonical.py b/qcengine/tests/test_harness_canonical.py index ca4c19db8..ed482ceb4 100644 --- a/qcengine/tests/test_harness_canonical.py +++ b/qcengine/tests/test_harness_canonical.py @@ -1,6 +1,7 @@ """ Tests the DQM compute dispatch module """ +import msgpack import numpy as np import pytest from qcelemental.models import AtomicInput, BasisSet @@ -148,3 +149,27 @@ def test_compute_bad_models(program, model): with pytest.raises(qcng.exceptions.InputError) as exc: ret = qcng.compute(inp, program, raise_error=True) + + +def test_psi4_restarts(monkeypatch): + """ + Make sure that a random error is raised which can be restarted if psi4 fails with no error message + """ + if not has_program("psi4"): + pytest.skip("Program psi4 not found.") + + # create the psi4 task + inp = AtomicInput(molecule=qcng.get_molecule("hydrogen"), driver="energy", model={"method": "hf", "basis": "6-31G"}) + + def mock_execute(*args, **kwargs): + """ + Mock the output of a failed psi4 task with missing error message. + """ + + mock_output = {"sucess": False, "outfiles": {"data.msgpack": msgpack.dumps({"missing": "data"})}} + return True, mock_output + + monkeypatch.setattr("qcengine.programs.psi4.execute", mock_execute) + + with pytest.raises(qcng.exceptions.RandomError): + _ = qcng.compute(input_data=inp, program="psi4", raise_error=True, task_config={"retries": 0})