Check that password expiry happens mid-session
Make the test more resilient