Revert "revert 1960e708db06c2047d7f605d4fea1493acd97a46, but with test fix". It doesnt fail for locally run tests but on jenkins CI