LPS-30240 Improve test to avoid outputing exception stack