// TestUint32ForNonUniqueIdOnSameProcessAndServerAcrossMultipleThreads tests Uint32() concurrently for
// any duplicate id generated  using same serverID.
TestUint32ForNonUniqueIdOnSameProcessAndServerAcrossMultipleThreads tests Uint32() concurrently for
any duplicate id generated  using same serverID.
// TestUint32ForNonUniqueIdOnSameProcessAndServerAcrossMultipleThreads tests Uint32 () concurrently for // any duplicate id generated using same serverID .
func TestUint32ForDuplicateIdOnSameProcessAndServerAcrossMultipleThreads(t *testing.T) {
	t.Parallel()
	ids := make(chan uint32, 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 <- Uint32(1, 0, &DefaultUint32Config)
			}
		}()
	}
	wg.Wait()
	close(ids)
	seen := make(map[uint32]struct{})
	for i := range ids {
		if _, ok := seen[i]; !ok {
			seen[i] = struct{}{}
			continue
		}
		t.Error("Duplicate Id found:", i)
		break
	}
}
func TestUint32ForDuplicateIdOnSameProcessAndServerAcrossMultipleThreads ( t * testing . T ) { t . Parallel ( ) ids := make ( chan uint32 , 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 <- Uint32 ( 1 , 0 , & DefaultUint32Config ) } } ( ) } wg . Wait ( ) close ( ids ) seen := make ( map [ uint32 ] struct { } ) for i := range ids { if _ , ok := seen [ i ] ; ! ok { seen [ i ] = struct { } { } continue } t . Error ( " " , i ) break } }
TestUint32ForNonUniqueIdOnSameProcessAndServerAcrossMultipleThreads tests Uint32() concurrently for
any duplicate id generated  using same serverID.
TestUint32ForNonUniqueIdOnSameProcessAndServerAcrossMultipleThreads tests Uint32 () concurrently for any duplicate id generated using same serverID .