New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#10331] Re-enable Azure DevOps Windows and macOS tests. #1719
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming the Azure jobs pass, this looks good to me.
b4d3e95
to
55013b2
Compare
def test_noWakerConstructionWarnings(self): | ||
""" | ||
No warnings are generated when constructing the waker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a test failing on Windows.
it was failing as it checked there are no warnings.
But there were warnings that were accumulated by running other tests.
I re-wrote a bit the test while trying to understand what it does.
@@ -22,6 +23,29 @@ | |||
from twisted.internet.tcp import Port | |||
|
|||
|
|||
class WarningCheckerTestCase(TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added trying to catch tests producing warnings, but not consuming the warnings.
I left this code here as maybe it can help with future debugging... and help localize tests with side-effects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I understand the skipping strategy. I left some words inline about this but there are other instances I skipped over because I suppose the answer will be the same.
self.assertEqual(len(warnings), 0, warnings) | ||
|
||
# Explicitly close the sockets as a cleanup and make sure we | ||
# don't get other warnings here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what "as a cleanup" means here. The word "cleanup" suggests "TestCase.addCleanup" but then the code just goes ahead and closes the socket immediately. So maybe just remove "as a cleanup"?
Or maybe it really should use TestCase.addCleanup
but that should happen on line 333 so that it happens even if the assertion on line 335 fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to rephrase. thanks.
@@ -71,6 +71,28 @@ def onlyOnPOSIX(testMethod): | |||
return testMethod | |||
|
|||
|
|||
def onlyOnLinuxCI(testMethod): | |||
""" | |||
Only run this test on Linux and macOS local tests and Linux CI platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again I don't understand why there is a CI check here. Why isn't the logic to run on Linux and skip on macOS and Windows, regardless of whether it is a CI environment or not?
testMethod.skip = "Failing on Azure macOS CI." | ||
|
||
if resource is None: | ||
testMethod.skip = "Test only applies to POSIX platforms." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For actually doing the skips, it seems like skipIf(not platform.isLinux(), "reason")
is the conventional idiom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I have refactored it...and the CI check was an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review.
I tried to update the PR based on your feedback.
I haven't refactored WarningCheckerTestCase into a fixture due to the fact that it would mean re-implementing flushWarnings
I hope this is ready to land now.
self.assertEqual(len(warnings), 0, warnings) | ||
|
||
# Explicitly close the sockets as a cleanup and make sure we | ||
# don't get other warnings here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to rephrase. thanks.
testMethod.skip = "Failing on Azure macOS CI." | ||
|
||
if resource is None: | ||
testMethod.skip = "Test only applies to POSIX platforms." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I have refactored it...and the CI check was an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Looks good to me. A few trivial comments inline to fix, but then please merge.
# https://twistedmatrix.com/trac/ticket/10332 | ||
# For now, try to start each test without previous warnings | ||
# on Windows CI environment. | ||
# We still want to see failures on local Windows development environment to make it easier to fix then, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo at the end - "then"
# https://twistedmatrix.com/trac/ticket/10332 | ||
# For now don't raise errors on Windows as the existing tests are dirty and we don't have the dev resources to fix this. | ||
# If you care about Twisted on Windows, enable this check and hunt for the test that is generating the warnings. | ||
# Note that even with this check disabled, you can still see flaky tests on Windows, as due due stray delayed calls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo - "as due due stray"
# We still want to run it on local development macOS environments to help developers discover and fix this issue. | ||
@skipIf( | ||
platform.isMacOSX() and os.environ.get("CI", "").lower() == "true", | ||
"Skipped on macOS CI en.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about "en" - typo? maybe "env"?
…nto 10331-win-mac-ci-azure
Scope and purpose
See if we can resurect Azure CI.
Remove py3.6 as it looks like it's no longer supported by Azure
Try to fix or skip the failing tests.
I tried to skip only on CI, so if a Twisted dev runs the test suite on mac or Windows, those tests will not be automatically skipped.
For the skipped tests, I have only left a comment without create separate tickets.
I don't have any hope that in the future someone will search the tickets hunting for tests that can be re-enabled.
Rather, someone found a bug, will see the existing test and then try to see if the test can be fixed as part of the current bugfix effort.
Reduce the size of Windows and MacOS CI matrix to reduce flaky reports.
At this point, we don't have active Twisted developers on mac and Windows.
Contributor Checklist:
tox -e lint
to format my patch to meet the Twisted Coding Standard#
character).review
to the keywords field in Trac, and putting a link to this PR in the comment; it shows up in https://twisted.reviews/ now.The first line is automatically generated by GitHub based on PR ID and branch name.
The other lines generated by GitHub should be replaced.