Timeline for Duplicate Username error in one sandbox but not in the other
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 13, 2018 at 23:03 | answer | added | gNerb | timeline score: 2 | |
Feb 13, 2018 at 21:52 | comment | added | Arthlete | @SarojBera I just checked and that's not the case(I used an extension that checks for a string across all classes). However I believe that Salesforce checks for this username's presence across all orgs not just the one running the test. Also I had isolated the change set to only run this particular test class and nothing outside of the scope of that class. | |
Feb 13, 2018 at 21:45 | comment | added | Saroj Bera | Maybe the same username is being used by some other test classes which is not present in other two Sandboxes. Are you sure all three Sandboxes are in sync in terms of test classes? | |
Feb 13, 2018 at 21:36 | history | edited | Arthlete | CC BY-SA 3.0 |
Added more information about my problem.
|
Feb 13, 2018 at 21:33 | comment | added | Arthlete | I also thought about the username not being random enough but if that was the case it would fail in the other 2 sandboxes too. I ran the test 3 times and it failed 3 times for the same error. Then I went back to the other sandbox and ran it there - no problem. I just tried again and it fails again. What I did was to change the username and push a new change set - test passed. Still a mystery why it passes in the other 2 sandboxes. | |
Feb 13, 2018 at 21:30 | comment | added | Adrian Larson♦ |
How many times has it failed this validation? If your method for creating test User records doesn't inject enough randomness, you may have a non-negligible chance of a naming collision. If it only failed once, run it again.
|
|
Feb 13, 2018 at 21:27 | comment | added | Arthlete | No I am not using it. | |
Feb 13, 2018 at 21:26 | comment | added | EricSSH | Are you using SeeAllData? | |
Feb 13, 2018 at 21:24 | history | asked | Arthlete | CC BY-SA 3.0 |