User who is getting Impersonated is getting logged out while running ATF test
We have seen issues when the test user is "Locked out" even though the user is "Active"
This field might not be present on the sys_user form. So please add the column in List view/View XML to find/edit the information.
<locked_out>true</locked_out> ==> This can create the issues with your ATF test. The test will fail with a message which is out of the context
Change the "locked_out" value to "true" and the issue should be resolved.