// TestUint64ForNonUniqueIdOnSameProcessAndServerAcrossMultipleThreads tests Uint64() concurrently for
// any duplicate id generated  using same serverID.
TestUint64ForNonUniqueIdOnSameProcessAndServerAcrossMultipleThreads tests Uint64() concurrently for
any duplicate id generated  using same serverID.
// TestUint64ForNonUniqueIdOnSameProcessAndServerAcrossMultipleThreads tests Uint64 () concurrently for // any duplicate id generated using same serverID .
func TestUint64ForDuplicateIdOnSameProcessAndServerAcrossMultipleThreads(t *testing.T) {
	t.Parallel()
	ids := make(chan uint64, 100_000)
	wg := &sync.WaitGroup{}
	wg.Add(10)
	for p := 0; p < 10; p++ {
		go func() {
			defer wg.Done()
			for c := 0; c < 10_000; c++ {
				ids <- Uint64(1, 0, &DefaultUint64Config)
			}
		}()
	}
	wg.Wait()
	close(ids)
	seen := make(map[uint64]struct{})
	for i := range ids {
		if _, ok := seen[i]; !ok {
			seen[i] = struct{}{}
		} else {
			t.Error("Duplicate Id found:", i)
		}
	}
}
func TestUint64ForDuplicateIdOnSameProcessAndServerAcrossMultipleThreads ( t * testing . T ) { t . Parallel ( ) ids := make ( chan uint64 , 100_000 ) wg := & sync . WaitGroup { } wg . Add ( 10 ) for p := 0 ; p < 10 ; p ++ { go func ( ) { defer wg . Done ( ) for c := 0 ; c < 10_000 ; c ++ { ids <- Uint64 ( 1 , 0 , & DefaultUint64Config ) } } ( ) } wg . Wait ( ) close ( ids ) seen := make ( map [ uint64 ] struct { } ) for i := range ids { if _ , ok := seen [ i ] ; ! ok { seen [ i ] = struct { } { } } else { t . Error ( " " , i ) } } }
TestUint64ForNonUniqueIdOnSameProcessAndServerAcrossMultipleThreads tests Uint64() concurrently for
any duplicate id generated  using same serverID.
TestUint64ForNonUniqueIdOnSameProcessAndServerAcrossMultipleThreads tests Uint64 () concurrently for any duplicate id generated using same serverID .