Skip to content

Fixing flaky tests for windows 7 32bit#23480

Merged
narph merged 14 commits intoelastic:masterfrom
narph:flaky-32bit
Jan 19, 2021
Merged

Fixing flaky tests for windows 7 32bit#23480
narph merged 14 commits intoelastic:masterfrom
narph:flaky-32bit

Conversation

@narph
Copy link
Copy Markdown
Contributor

@narph narph commented Jan 13, 2021

Will update soon

What does this PR do?

After investigation we see 2 main issues:

  1. constant .... overflows int

Because the int value is overflowed, the fix is to specify the int64 type instead.

  1. Tests failing consistently most likely due to expfmt package. This happens in function https://github.com/elastic/beats/blob/master/metricbeat/helper/prometheus/prometheus.go#L72
    When trying to read and parse the data, lines for example:
etcd_disk_wal_fsync_duration_seconds_bucket{le="0.002"} 0	
etcd_disk_wal_fsync_duration_seconds_bucket{le="0.004"} 0	

are not considered.

Why is it important?

Should fix/skip the following:
(etcd failing tests were previously fixed)
image

image

Python tests

image

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 13, 2021
@narph narph self-assigned this Jan 13, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jan 13, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: narph commented: /test

    • Start Time: 2021-01-18T09:26:51.675+0000
  • Duration: 48 min 39 sec

  • Commit: 871f370

Test stats 🧪

Test Results
Failed 0
Passed 10070
Skipped 2468
Total 12538

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 10070
Skipped 2468
Total 12538

@narph
Copy link
Copy Markdown
Contributor Author

narph commented Jan 13, 2021

@v1v , most of tests are failing consistently most likely due to expfmt package. This happens in function https://github.com/elastic/beats/blob/master/metricbeat/helper/prometheus/prometheus.go#L72
When trying to read and parse the data, lines for example:

etcd_disk_wal_fsync_duration_seconds_bucket{le="0.002"} 0	
etcd_disk_wal_fsync_duration_seconds_bucket{le="0.004"} 0	

are not considered.

If we change the value 0 to 1 then everything is fine. This PR fixes the etcd module tests. I have upgraded the package but error still consists. I am not sure there is a solution for this tests for 32 bit os's.
What should we do in this case? Update test files? Make sure we skip these specific tests for this os?

@narph narph changed the title Fixing flaky tests for windows 7 32bit Fixing flakey tests for windows 7 32bit Jan 13, 2021
@v1v v1v added the windows-7-32 Enable builds in the CI for windows-7 32 bits label Jan 13, 2021
v1v and others added 3 commits January 13, 2021 13:03
windows stage is mandatory, but optional stages are not mandatory for PRs
@narph narph changed the title Fixing flakey tests for windows 7 32bit Fixing flaky tests for windows 7 32bit Jan 13, 2021
@andresrc andresrc added the Team:Integrations Label for the Integrations team label Jan 13, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/integrations (Team:Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 13, 2021
@narph
Copy link
Copy Markdown
Contributor Author

narph commented Jan 14, 2021

running the tests again

/test

@narph
Copy link
Copy Markdown
Contributor Author

narph commented Jan 14, 2021

/test

// under the License.

// +build !integration
// +build !integration, !386
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these tests failing in all 32-bit platforms or only in Windows?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only windows 32 bit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we explicitly skip the tests only for Windows 32 bits instead of for all 386 platforms? With a comment to know what they are skipped.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I have made the changes


assert isinstance(udp["all"]["count"], int)

@unittest.skipIf(sys.platform == "win32", "Flaky test")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests should have a open issue to address them in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have created one separately but I had around 40+ tests, it would have been hard to manage the tickets, I have taken screenshots with all the ones that kept on popping up

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm, does this test always fail in win32? If it always fail maybe instead of skipping it because of flakiness we can say in the comment that this test (or this feature) is not supported in win 32.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test does not always fail, it passed previously.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we plan to fix these flakiness at some moment we should have an issue for that, and reference it in the comment. Flaky tests can be hiding bugs.
But possibly it doesn't make much sense to dedicate a lot of effort to corner cases in 32-bits Windows 🙂

@narph narph requested a review from jsoriano January 14, 2021 11:33
@v1v v1v added windows-10 Enable builds in the CI for windows-10 windows-2008 Enable builds in the CI for windows-2008 windows-2012 Enable builds in the CI for windows-2012 windows-2016 Enable builds in the CI for windows-2016 windows-7 Enable builds in the CI for windows-7 labels Jan 14, 2021
@v1v v1v added the windows-8 Enable builds in the CI for windows-8 label Jan 14, 2021
@v1v
Copy link
Copy Markdown
Member

v1v commented Jan 14, 2021

I've just added all the labels for all the windows that we support to validate there are no any regressions.

/test

@narph
Copy link
Copy Markdown
Contributor Author

narph commented Jan 14, 2021

/test

Copy link
Copy Markdown
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!


assert isinstance(udp["all"]["count"], int)

@unittest.skipIf(sys.platform == "win32", "Flaky test")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we plan to fix these flakiness at some moment we should have an issue for that, and reference it in the comment. Flaky tests can be hiding bugs.
But possibly it doesn't make much sense to dedicate a lot of effort to corner cases in 32-bits Windows 🙂

@narph
Copy link
Copy Markdown
Contributor Author

narph commented Jan 14, 2021

/test

1 similar comment
@narph
Copy link
Copy Markdown
Contributor Author

narph commented Jan 18, 2021

/test

@narph narph merged commit 1b43637 into elastic:master Jan 19, 2021
@narph narph deleted the flaky-32bit branch January 19, 2021 09:07
@narph narph added the v7.12.0 label Jan 19, 2021
narph added a commit to narph/beats that referenced this pull request Jan 19, 2021
* enabling testing on windows 32 bit

* update test file

* fix

* [CI] Optional stage instead the mandatory one

windows stage is mandatory, but optional stages are not mandatory for PRs

* fix int issue

* ignore 386 architecture

* skip tests

* skip test

* function redeclared

* re write

* add windows constraint

* add tag

* add comments

Co-authored-by: Victor Martinez <VictorMartinezRubio@gmail.com>
(cherry picked from commit 1b43637)
narph added a commit to narph/beats that referenced this pull request Jan 19, 2021
* enabling testing on windows 32 bit

* update test file

* fix

* [CI] Optional stage instead the mandatory one

windows stage is mandatory, but optional stages are not mandatory for PRs

* fix int issue

* ignore 386 architecture

* skip tests

* skip test

* function redeclared

* re write

* add windows constraint

* add tag

* add comments

Co-authored-by: Victor Martinez <VictorMartinezRubio@gmail.com>
(cherry picked from commit 1b43637)
@narph narph added the v7.11.0 label Jan 19, 2021
narph added a commit that referenced this pull request Jan 19, 2021
* enabling testing on windows 32 bit

* update test file

* fix

* [CI] Optional stage instead the mandatory one

windows stage is mandatory, but optional stages are not mandatory for PRs

* fix int issue

* ignore 386 architecture

* skip tests

* skip test

* function redeclared

* re write

* add windows constraint

* add tag

* add comments

Co-authored-by: Victor Martinez <VictorMartinezRubio@gmail.com>
(cherry picked from commit 1b43637)
narph added a commit that referenced this pull request Jan 19, 2021
* enabling testing on windows 32 bit

* update test file

* fix

* [CI] Optional stage instead the mandatory one

windows stage is mandatory, but optional stages are not mandatory for PRs

* fix int issue

* ignore 386 architecture

* skip tests

* skip test

* function redeclared

* re write

* add windows constraint

* add tag

* add comments

Co-authored-by: Victor Martinez <VictorMartinezRubio@gmail.com>
(cherry picked from commit 1b43637)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team:Integrations Label for the Integrations team v7.11.0 v7.12.0 windows-7-32 Enable builds in the CI for windows-7 32 bits windows-7 Enable builds in the CI for windows-7 windows-8 Enable builds in the CI for windows-8 windows-10 Enable builds in the CI for windows-10 windows-2008 Enable builds in the CI for windows-2008 windows-2012 Enable builds in the CI for windows-2012 windows-2016 Enable builds in the CI for windows-2016

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Metricbeat] in windows-7-32bits got some flakiness tests

5 participants