MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / TestMatchRemoteCache

Function TestMatchRemoteCache

internal/waf/utils/utils_test.go:31–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestMatchRemoteCache(t *testing.T) {
32 if !testutils.IsSingleTesting() {
33 return
34 }
35
36 var client = http.Client{}
37 for i := 0; i < 200_0000; i++ {
38 req, err := http.NewRequest(http.MethodGet, "http://192.168.2.30:8882/?arg="+strconv.Itoa(i), nil)
39 if err != nil {
40 t.Fatal(err)
41 }
42 req.Header.Set("User-Agent", "GoTest/"+strconv.Itoa(i))
43 resp, err := client.Do(req)
44 if err != nil {
45 t.Fatal(err)
46 }
47 _ = resp.Body.Close()
48 }
49}
50
51func TestMatchBytesCache_WithoutCache(t *testing.T) {
52 data := []byte(strings.Repeat("HELLO", 512))

Callers

nothing calls this directly

Calls 4

IsSingleTestingFunction · 0.92
DoMethod · 0.80
CloseMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected