No, CRED_PERSIST_LOCAL_MACHINE should be fine but does this change make any difference? I believe the ERROR_NO_SUCH_LOGON_SESSION is returned when the tests are being run as a user that doesn't have a profile, and therefore the credentials manager doesn't have anywhere to store the credentials. Changing the persist type shouldn't affect this, so I don't see why it would make these calls start working.
I don't know whether it would make a difference, I don't see the failures myself. I just see a fairly consistent pattern of failure, and reading MSDN made me suppose that a different persist type might make a difference.
Never mind, I'll send the patch as-is then. Thanks for the feedback. --Juan