Start with a fresh Dgraph runtime, and try without @upsert directive on email first. You should see 20 email ids (same value) in Dgraph. You should not see any Transaction has been aborted. Please retry message. This is what you might have seen in the system.
Now, drop data from Dgraph and add the @upsert directive on email. Run the test again. This time only one node will be created. The @upsert directive enforces uniqueness for the email field when running transactions concurrently. At this time, you should see Transaction has been aborted. Please retry. This is caused by the @upsert directive enforcing uniqueness on the email attribute.
Please note that the presence of an index is mandatory for @upsert to work.