1
0

Reliability threshold flag

This commit is contained in:
dump_stack() 2023-01-31 09:34:12 +00:00
parent ce7794ce84
commit 330da3b930
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

5
pew.go
View File

@ -41,6 +41,8 @@ type PewCmd struct {
QemuTimeout time.Duration `help:"timeout for qemu"` QemuTimeout time.Duration `help:"timeout for qemu"`
DockerTimeout time.Duration `help:"timeout for docker"` DockerTimeout time.Duration `help:"timeout for docker"`
Threshold float64 `help:"Reliablity threshold for exit code" default:"1.00"`
} }
func (cmd PewCmd) Run(g *Globals) (err error) { func (cmd PewCmd) Run(g *Globals) (err error) {
@ -104,6 +106,9 @@ func (cmd PewCmd) Run(g *Globals) (err error) {
return return
} }
if successRate(state) < *threshold {
err = errors.New("reliability threshold not met")
}
return return
} }