MCPcopy
hub / github.com/probelabs/goreplay / TestOutputLimiter

Function TestOutputLimiter

limiter_test.go:10–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestOutputLimiter(t *testing.T) {
11 wg := new(sync.WaitGroup)
12
13 input := NewTestInput()
14 output := NewLimiter(NewTestOutput(func(*Message) {
15 wg.Done()
16 }), "10")
17 wg.Add(10)
18
19 plugins := &InOutPlugins{
20 Inputs: []PluginReader{input},
21 Outputs: []PluginWriter{output},
22 }
23 plugins.All = append(plugins.All, input, output)
24
25 emitter := NewEmitter()
26 go emitter.Start(plugins, Settings.Middleware)
27
28 for i := 0; i < 100; i++ {
29 input.EmitGET()
30 }
31
32 wg.Wait()
33 emitter.Close()
34}
35
36func TestInputLimiter(t *testing.T) {
37 wg := new(sync.WaitGroup)

Callers

nothing calls this directly

Calls 7

StartMethod · 0.95
EmitGETMethod · 0.95
CloseMethod · 0.95
NewTestInputFunction · 0.85
NewLimiterFunction · 0.85
NewTestOutputFunction · 0.85
NewEmitterFunction · 0.85

Tested by

no test coverage detected