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

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

	wg.Add(10)

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

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