Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/fuzz/execute_race_test.go
4538 views
1
package fuzz
2
3
import (
4
"sync"
5
"testing"
6
7
"github.com/projectdiscovery/nuclei/v3/pkg/protocols"
8
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/interactsh"
9
)
10
11
func TestEvaluateVarsWithInteractsh_RaceCondition(t *testing.T) {
12
rule := &Rule{}
13
rule.options = &protocols.ExecutorOptions{
14
Interactsh: &interactsh.Client{},
15
}
16
17
sharedData := map[string]interface{}{
18
"var1": "value1",
19
"var2": "{{var1}}_suffix",
20
"var3": "prefix_{{var1}}",
21
}
22
23
var wg sync.WaitGroup
24
for i := 0; i < 10; i++ {
25
wg.Add(1)
26
go func() {
27
defer wg.Done()
28
rule.evaluateVarsWithInteractsh(sharedData, nil)
29
}()
30
}
31
wg.Wait()
32
}
33
34