You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: singleflight_test.go
    path of file: ./repos/juicefs/pkg/chunk
    
    the code of the file until where you have to start completion: /*
 * JuiceFS, Copyright 2020 Juicedata, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in complian
    
func TestSingleFlight(t *testing.T) {
	g := &Controller{}
	gp := &sync.WaitGroup{}
	var cache sync.Map
	var n int32
	iters := 100000
	for i := 0; i < iters; i++ {
		gp.Add(1)
		go func(k int) {
			p, _ := g.Execute(strconv.Itoa(k/100), func() (*Page, error) {
				time.Sleep(time.Microsecond * 500000) // In most cases 500ms is enough to run 100 goroutines
				atomic.AddInt32(&n, 1)
				return NewOffPage(100), nil
			})
			p.Release()
			cache.LoadOrStore(strconv.Itoa(k/100), p)
			gp.Done()
		}(i)
	}
	gp.Wait()

	nv := int(atomic.LoadInt32(&n))
	if nv != iters/100 {
		t.Fatalf("singleflight doesn't take effect: %v", nv)
	}

	// verify the ref
	cache.Range(func(key any, value any) bool {
		if value.(*Page).refs != 0 {
			t.Fatal("refs of page is not 0")
		}
		return true
	})

}