fixing instability of CDI tests

Closes #764