added unit test for id generator
fixed racing condition
Revert "fixed racing condition"

This reverts commit 701eb180a7f37c00609c85c1b6983610da3bcc47.
fixed race condition