func TestUint32ForNonUniqueIdOnDifferentServerIDsAcrossMultipleThreads(t *testing.T) {
	t.Parallel()

	ids := make(chan uint32, 10_240)
	wg := &sync.WaitGroup{}

	wg.Add(10)

	for p := 0; p < 10; p++ {
		go func() {
			defer wg.Done()

			for c := 0; c < 1024; 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
	}
}
// TestUint32ForNonUniqueIdOnDifferentServerIDsAcrossMultipleThreads tests Uint32() concurrently
// for any duplicate ids generated using different serverIDs upto the maximum 1024.
TestUint32ForNonUniqueIdOnDifferentServerIDsAcrossMultipleThreads tests Uint32() concurrently
for any duplicate ids generated using different serverIDs upto the maximum 1024.
// TestUint32ForNonUniqueIdOnDifferentServerIDsAcrossMultipleThreads tests Uint32 () concurrently // for any duplicate ids generated using different serverIDs upto the maximum 1024 .
func TestUint32ForNonUniqueIdOnDifferentServerIDsAcrossMultipleThreads(t *testing.T) {
	t.Parallel()
	ids := make(chan uint32, 10_240)
	wg := &sync.WaitGroup{}
	wg.Add(10)
	for p := 0; p < 10; p++ {
		go func() {
			defer wg.Done()
			for c := 0; c < 1024; 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 TestUint32ForNonUniqueIdOnDifferentServerIDsAcrossMultipleThreads ( t * testing . T ) { t . Parallel ( ) ids := make ( chan uint32 , 10_240 ) wg := & sync . WaitGroup { } wg . Add ( 10 ) for p := 0 ; p < 10 ; p ++ { go func ( ) { defer wg . Done ( ) for c := 0 ; c < 1024 ; 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 } }
TestUint32ForNonUniqueIdOnDifferentServerIDsAcrossMultipleThreads tests Uint32() concurrently
for any duplicate ids generated using different serverIDs upto the maximum 1024.
TestUint32ForNonUniqueIdOnDifferentServerIDsAcrossMultipleThreads tests Uint32 () concurrently for any duplicate ids generated using different serverIDs upto the maximum 1024 .