implement configurable timeout for OBD tests (#9324)

This commit is contained in:
Sidhartha Mani
2020-04-14 11:48:32 -07:00
committed by GitHub
parent 37d066b563
commit ec11e99667
4 changed files with 63 additions and 20 deletions

View File

@@ -221,11 +221,14 @@ var OBDDataTypesList = []OBDDataType{
// ServerOBDInfo - Connect to a minio server and call OBD Info Management API
// to fetch server's information represented by OBDInfo structure
func (adm *AdminClient) ServerOBDInfo(ctx context.Context, obdDataTypes []OBDDataType) <-chan OBDInfo {
func (adm *AdminClient) ServerOBDInfo(ctx context.Context, obdDataTypes []OBDDataType, deadline time.Duration) <-chan OBDInfo {
respChan := make(chan OBDInfo)
go func() {
v := url.Values{}
v.Set("deadline",
deadline.Truncate(1*time.Second).String())
// start with all set to false
for _, d := range OBDDataTypesList {
v.Set(string(d), "false")