Skip to content

Commit

Permalink
Fix flaky test TestAddCounterInvalidArgWhenQueryClosed (elastic#27313)
Browse files Browse the repository at this point in the history
* fix flaky test

* changelog

* changelog

(cherry picked from commit 1a0fb52)
  • Loading branch information
narph committed Aug 11, 2021
1 parent 317b420 commit 0053629
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Allow metric prefix override per service in gcp module. {pull}26960[26960]
- Change `server_status_path` default setting to `nginx_status` for the `nginx` module. {pull}26642[26642]
- Fix cloudwatch metricset collecting duplicate data points. {pull}27248[27248]
- Fix flaky test TestAddCounterInvalidArgWhenQueryClosed. {issue}27312[27312] {pull}27313[27313]

*Packetbeat*

Expand Down
8 changes: 7 additions & 1 deletion metricbeat/helper/windows/pdh/pdh_query_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,13 @@ func (q *Query) ExpandWildCardPath(wildCardPath string) ([]string, error) {
return UTF16ToStringArray(expdPaths), nil
} else {
if expdPaths, err = PdhExpandWildCardPath(utfPath); err != nil {
return nil, err
if err == PDH_MORE_DATA {
if expdPaths, err = PdhExpandWildCardPath(utfPath); err != nil {
return nil, err
}
} else {
return nil, err
}
}
paths := UTF16ToStringArray(expdPaths)
// in several cases ExpandWildCardPath win32 api seems to return initial wildcard without any errors, adding some waiting time between the 2 ExpandWildCardPath api calls seems to be succesfull but that will delay data retrieval
Expand Down

0 comments on commit 0053629

Please sign in to comment.