Improve diagnostic message in credentials test