Random failures in test_gwsi
I occasionally get failures like this:
=================================== FAILURES ===================================
_________________________ test_response_gwsi[off-si0] __________________________
in_tmp_dir = PosixPath('/tmp/pytest-of-askhl/pytest-51/test_response_gwsi2')
si = Atoms(symbols='Si2', pbc=True, cell=[[0.0, 2.715, 2.715], [2.715, 0.0, 2.715], [2.715, 2.715, 0.0]], calculator=GPAW(...))
symm = 'off'
@pytest.mark.response
@pytest.mark.slow
@pytest.mark.parametrize('si', generate_si_systems())
@pytest.mark.parametrize('symm', [{},
'off',
{'time_reversal': False},
{'point_group': False}])
def test_response_gwsi(in_tmp_dir, si, symm):
e, r = run(si, symm)
G, X = r['eps'][0]
results = [e, G[0], G[1] - G[0], X[1] - G[0], X[2] - X[1]]
G, X = r['qp'][0]
results += [G[0], G[1] - G[0], X[1] - G[0], X[2] - X[1]]
> assert results == pytest.approx(
[-9.253,
5.442, 2.389, 0.403, 0.000,
6.261, 3.570, 1.323, 0.001], abs=0.003)
E assert [-9.252680571...45936323, ...] == approx([-9.25...01 ± 3.0e-03])
E comparison failed. Mismatched elements: 1 / 9:
E Max absolute difference: 0.0035745041229390253
E Max relative difference: 1.3884243148379234
E Index | Obtained | Expected
E 8 | -0.0025745041229390253 | 0.001 ± 3.0e-03
/home/askhl/src/gpaw/gpaw/test/response/test_gwsi.py:65: AssertionError
________________________ test_response_gwsi[symm3-si0] _________________________
in_tmp_dir = PosixPath('/tmp/pytest-of-askhl/pytest-51/test_response_gwsi6')
si = Atoms(symbols='Si2', pbc=True, cell=[[0.0, 2.715, 2.715], [2.715, 0.0, 2.715], [2.715, 2.715, 0.0]], calculator=GPAW(...))
symm = {'point_group': False}
@pytest.mark.response
@pytest.mark.slow
@pytest.mark.parametrize('si', generate_si_systems())
@pytest.mark.parametrize('symm', [{},
'off',
{'time_reversal': False},
{'point_group': False}])
def test_response_gwsi(in_tmp_dir, si, symm):
e, r = run(si, symm)
G, X = r['eps'][0]
results = [e, G[0], G[1] - G[0], X[1] - G[0], X[2] - X[1]]
G, X = r['qp'][0]
results += [G[0], G[1] - G[0], X[1] - G[0], X[2] - X[1]]
> assert results == pytest.approx(
[-9.253,
5.442, 2.389, 0.403, 0.000,
6.261, 3.570, 1.323, 0.001], abs=0.003)
E assert [-9.252680571...45936322, ...] == approx([-9.25...01 ± 3.0e-03])
E comparison failed. Mismatched elements: 1 / 9:
E Max absolute difference: 0.0035745041229408017
E Max relative difference: 1.3884243148376554
E Index | Obtained | Expected
E 8 | -0.0025745041229408017 | 0.001 ± 3.0e-03
/home/askhl/src/gpaw/gpaw/test/response/test_gwsi.py:65: AssertionError
================================ GPAW-MPI stuff ================================
size: 1
=========================== short test summary info ============================
FAILED test_gwsi.py::test_response_gwsi[off-si0] - assert [-9.252680571...459...
FAILED test_gwsi.py::test_response_gwsi[symm3-si0] - assert [-9.252680571...4...
========================= 2 failed, 6 passed in 24.20s =========================