There seems to be a subtle bug on PersonSet.createPersonAndEmail(), in which the insert SQL command to create the email address is sent to the database before the insert command to create the person. In this case, what happens is OOPS-53D119.
I guess that like bug 31651, this one could be fixed by placing a flush_database_updates() call after the call to PersonSet._newPerson(), but it's not trivial to test that that would actually solve the problem and I don't think this is the right thing to do.
There seems to be a subtle bug on PersonSet. createPersonAnd Email() , in which the insert SQL command to create the email address is sent to the database before the insert command to create the person. In this case, what happens is OOPS-53D119.
I guess that like bug 31651, this one could be fixed by placing a flush_database_ updates( ) call after the call to PersonSet. _newPerson( ), but it's not trivial to test that that would actually solve the problem and I don't think this is the right thing to do.