MCPcopy
hub / github.com/istio/istio / Stop

Method Stop

pkg/test/framework/components/echo/util/traffic/generator.go:97–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95}
96
97func (g *generator) Stop() Result {
98 // Trigger the generator to stop.
99 close(g.stop)
100
101 // Wait for the generator to exit.
102 t := time.NewTimer(g.StopTimeout)
103 select {
104 case <-g.stopped:
105 t.Stop()
106 if g.result.TotalRequests == 0 {
107 g.t.Fatal("no requests completed before stopping the traffic generator")
108 }
109 return g.result
110 case <-t.C:
111 g.t.Fatal("timed out waiting for result")
112 }
113 // Can never happen, but the compiler doesn't know that Fatal terminates
114 return Result{}
115}
116
117func fillInDefaults(cfg *Config) {
118 if cfg.Interval == 0 {

Callers

nothing calls this directly

Calls 2

StopMethod · 0.65
FatalMethod · 0.65

Tested by

no test coverage detected