-
-
Notifications
You must be signed in to change notification settings - Fork 442
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
Tests: Collection of flukes on CI #692
Comments
It looks like there is a mixup of NotifyMSTeams vs. NotifyMatrix here. It happened on PyPy 3.9 with #694. ________________________ test_plugin_msteams_templating ________________________
[...]
> assert mock_post.call_args_list[0][0][0].startswith(
'https://outlook.office.com/webhook/')
E AssertionError: assert False
E + where False = <bound method str.startswith of 'http://host:/_matrix/client/r0/logout'>('https://outlook.office.com/webhook/')
E + where <bound method str.startswith of 'http://host:/_matrix/client/r0/logout'> = 'http://host:/_matrix/client/r0/logout'.startswith
test/test_plugin_msteams.py:371: AssertionError There is also a warning. test/test_plugin_msteams.py::test_plugin_msteams_templating
/home/travis/build/caronc/apprise/.tox/pypy39/lib/pypy3.9/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: : <function NotifyMatrix.__del__ at 0x000000000a4848e0>
Traceback (most recent call last):
File "/home/travis/build/caronc/apprise/apprise/plugins/NotifyMatrix.py", line 1020, in _fetch
response = loads(r.content)
AttributeError: 'Request' object has no attribute 'content' -- https://app.travis-ci.com/github/caronc/apprise/jobs/585483224#L915 |
This might be tied to the reloading of modules that already executed code (and were populated in that matrix found in ./bin/test.sh msteams I'll bet it might work fine |
Hi Chris, thanks for your response. The error reported above was only a fluke on CI, it is not deterministically reproducable right now, neither individually nor in combination. I also never observed it on my workstation, even when running the tests in parallel using I will definitively take all your valuable information into account (very much appreciated, please keep it coming) when eventually giving dedicated love to this part of the test harness within any future iterations. I think it is acceptable to have a small amount of flukes in the CI setup of a project as heavy as Apprise. But this doesn't mean we can't do better, so please consider my efforts here only as a long-term endeavor. With kind regards, |
Another fluke on PyPy 3.9 with #690.
-- https://app.travis-ci.com/github/caronc/apprise/jobs/585628603#L763 |
I applaud your efforts to improve the CI and testing. I feel you're going through the same circles i did and eventually gave up as it's only reproducible randomly on Travis-CI. You seemed like a fresh pair of eyes and you were so engaged in the matter, so i didn't want to stop you. As discussed earlier, I personally believe the random failing of these modules is related to the (test case) hacking of the module loading just for test coverage. I think dropping all of this (except windows one) and leveraging the the Alternatively, place the |
Dear Chris, thanks for your response.
Thank you, I appreciate it.
I tried my best to reflect the state of the onion within #697, did you read my ramblings over there?
I agree. Just to make sure our ideas match up reasonably: Is your proposal going into the same direction as I proposed in #697 in any way, or would it be an alternative path out of the module reloading hell you would be in favor to consider?
I hear you. I don't want to argue too much against having such a
If I still can find more time to dedicate to the code base, I will surely use a Windows runner, probably on GHA, to improve the test cases on this matter. The build at [1] shows the current state of affairs on this matter. With kind regards, [1] https://github.com/panodata/apprise/actions/runs/3238651908 |
#697 is out of the loop, sorry for the noise. So, let's follow your proposal and keep the On the other details, I am not fully convinced yet that the flukes are caused by module reloading woes. Let's see if it will get better with #687 down the line. If you think it is more appropriate, feel free to move this issue into a discussion. My intention is to mereley use it to track all flukes I am observing, mostly on CI. One first outcome from tracking the three items here is, that all of them only happened on PyPy builds, CPython seems to be fine, until further notice. |
PyPy 3.6 strikes again with #698. Another apparent mixup between NotifyMSTeams vs. NotifyMatrix here, no? ________________________ test_plugin_msteams_templating ________________________
[...]
assert mock_post.called is True
> assert mock_post.call_args_list[0][0][0].startswith(
'https://outlook.office.com/webhook/')
E AssertionError: assert False
E + where False = <bound method str.startswith of 'http://host:/_matrix/client/r0/logout'>('https://outlook.office.com/webhook/')
E + where <bound method str.startswith of 'http://host:/_matrix/client/r0/logout'> = 'http://host:/_matrix/client/r0/logout'.startswith
test/test_plugin_msteams.py:225: AssertionError
----------------------------- Captured stderr call -----------------------------
Exception ignored in: <bound method NotifyMatrix.__del__ of <apprise.plugins.NotifyMatrix.NotifyMatrix object at 0x000000000a7ca448>>
Traceback (most recent call last):
File "/home/travis/build/caronc/apprise/apprise/plugins/NotifyMatrix.py", line 1020, in _fetch
response = loads(r.content)
AttributeError: 'Request' object has no attribute 'content' -- https://app.travis-ci.com/github/caronc/apprise/jobs/585672683#L826 |
That's a bit of a new one. Your amazing and growing merge request has gotten so big (with so many fine little fixes in it), it's hard to see where/what is triggering some of these now 😉 . the Request() object is mocked in a lot of these cases. I wonder if |
You made another comment about the CI Credits; don't' worry about them. Travis CI is fantastic and while i only get credits now in small bursts (that have run out fast only because of the amazing extensive testing you've done), they're all free. So don't worry about exhausting credits at all. I know it's a bit of delay/thump in your productivity, but dont' let it hold you back or feel you need to work around limiting the occurrences of runners. |
Are you referring to #687? Well, all the flukes have not been on this one, but on the rather small changes with #690, #694, and #698 instead, which do not leverage the improvements from #687 yet - I've just retroactively edited the reports above to include those references. Until further contrary insights, I am slightly confident that #687 will improve the situation on this matter.
Yeah, it's weird. Thanks so far for sharing your analysis on all the occurrances right away, I will try to take them into consideration when eventually dedicating some time to this specific topic. I will keep on posting all my observations here, maybe we will see the light. So far, I can only say the spots have only happened on PyPy builds, and never on #687 yet. |
Another fluke on PyPy 3.9, on behalf of #700.
-- https://app.travis-ci.com/github/caronc/apprise/jobs/585748460#L803 |
Some mocking problems on PyPy 3.6 with https://github.com/caronc/apprise/actions/runs/3271649948/jobs/5381689500#step:10:535 |
On behalf of #707, this guy failed on CPython 3.9 on Windows.
-- https://github.com/caronc/apprise/actions/runs/3273052301/jobs/5384798729#step:10:469 |
The previous runner was so slow, this test passed. 0.4995 is pretty close. I think the test just needs to be tweaked to allow for this. No worries here at all |
PyPy 3.8 on behalf of #707. ________________________ test_plugin_fcm_general_oauth _________________________
mock_post.reset_mock()
obj = Apprise.instantiate(
'fcm://mock-project-id/device/?keyfile={}'
'&color=#12AAbb'.format(str(path)))
> assert mock_post.call_count == 0
E AssertionError: assert 1 == 0
E + where 1 = <MagicMock name='post' id='351584512'>.call_count
test/test_plugin_fcm.py:508: AssertionError -- https://github.com/caronc/apprise/actions/runs/3277555883/jobs/5394983838#step:10:537 |
PyPy 3.9 on behalf of #707. Two in one.
test_plugin_msteams_templating
-- https://github.com/caronc/apprise/actions/runs/3277609113/jobs/5395106847#step:10:556 test_plugin_twitter_tweet_attachments
-- https://github.com/caronc/apprise/actions/runs/3277609113/jobs/5395106847#step:10:836 |
Another fluke on PyPy 3.9 on behalf of #707. It already happened at #692 (comment) and a different one at #692 (comment).
-- https://github.com/caronc/apprise/actions/runs/3277845543/jobs/5395580516#step:10:396 |
Thanks for reporting. I see that both To be more specific, we did not see a fluke on _______________________ test_plugin_pushover_attachments _______________________
> assert mock_post.call_count == 2
E AssertionError: assert 23 == 2
E + where 23 = <MagicMock name='post' id='188343032'>.call_count
test/test_plugin_pushover.py:244: AssertionError -- https://github.com/caronc/apprise/actions/runs/3307979727/jobs/5460021990#step:10:423 ________________________ test_plugin_fcm_general_oauth _________________________
# Test our call count
> assert mock_post.call_count == 2
E AssertionError: assert 3 == 2
E + where 3 = <MagicMock name='post' id='388993832'>.call_count
test/test_plugin_fcm.py:514: AssertionError -- https://github.com/caronc/apprise/actions/runs/3307979727/jobs/5460189083#step:10:553 |
Another fluke on PyPy 3.9 on behalf of #727. It is
|
PyPy 3.6 failed on
-- https://github.com/caronc/apprise/actions/runs/3358072072/jobs/5564532037#step:10:472 |
[1] https://github.com/caronc/apprise/actions/runs/3358072072 |
On behalf of #728, when refactoring the test cases, we observed this one on PyPy3.8 at [1]: test/test_plugin_twitter.py::test_plugin_twitter_tweet_attachments_bad_media_response_unparseable
/opt/hostedtoolcache/PyPy/3.8.13/x64/lib/pypy3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: : <function NotifyTwist.__del__ at 0x0000000006a74d40>
Traceback (most recent call last):
File "/home/runner/work/apprise/apprise/apprise/plugins/NotifyTwist.py", line 791, in __del__
self.logout()
File "/home/runner/work/apprise/apprise/apprise/plugins/NotifyTwist.py", line 353, in logout
postokay, response = self._fetch('users/logout')
File "/home/runner/work/apprise/apprise/apprise/plugins/NotifyTwist.py", line 641, in _fetch
timeout=self.request_timeout,
File "/opt/hostedtoolcache/PyPy/3.8.13/x64/lib/pypy3.8/unittest/mock.py", line 1081, in __call__
return self._mock_call(*args, **kwargs)
File "/opt/hostedtoolcache/PyPy/3.8.13/x64/lib/pypy3.8/unittest/mock.py", line 1085, in _mock_call
return self._execute_mock_call(*args, **kwargs)
File "/opt/hostedtoolcache/PyPy/3.8.13/x64/lib/pypy3.8/unittest/mock.py", line 1142, in _execute_mock_call
result = next(effect)
StopIteration Isn't it weird that something related to [1] https://github.com/caronc/apprise/actions/runs/3371826071/jobs/5594557259#step:10:456 |
On behalf of #728, PyPy3.8 strikes again.
-- https://github.com/caronc/apprise/actions/runs/3371988866/jobs/5594890639 |
On PyPy3.8 again, with the refactorings from #728.
-- https://github.com/caronc/apprise/actions/runs/3376304064/jobs/5603868430#step:10:446 |
It's definitely weird; it's a always a mock result that fails with completely erroneous information. It's pure randomness makes it impossible to determine its cause. |
PyPy3.9 and PyPy3.8 again, also with the refactorings from #728.
-- https://github.com/caronc/apprise/actions/runs/3383323341/jobs/5619109413#step:10:394
-- https://github.com/caronc/apprise/actions/runs/3383386910/jobs/5619232781#step:10:394 |
I've refactored the test modules |
PyPy3.9. __________________ ERROR collecting test/test_config_base.py ___________________
/opt/hostedtoolcache/PyPy/3.9.12/x64/lib/pypy3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
/opt/hostedtoolcache/PyPy/3.9.12/x64/lib/pypy3.9/site-packages/_pytest/assertion/rewrite.py:159: in exec_module
source_stat, co = _rewrite_test(fn, self.config)
/opt/hostedtoolcache/PyPy/3.9.12/x64/lib/pypy3.9/site-packages/_pytest/assertion/rewrite.py:339: in _rewrite_test
co = compile(tree, strfn, "exec", dont_inherit=True)
E TypeError: expected some sort of stmt, got 'visit_Assert' -- https://github.com/caronc/apprise/actions/runs/3465267998/jobs/5787797672#step:10:37 |
PyPy3.9 again.
-- https://github.com/caronc/apprise/actions/runs/3665208554/jobs/6196128736#step:10:125 |
Dear Chris, I hope you are doing well. I wish you and your family and happy new year. On this matter, may I ask how it was going lately? Did you observe any of the listed, or otherwise similar hiccups on CI? With kind regards, |
Sorry for the late response. It still fails on the odd deployment yeah. Like in the past, it's nothing a kick doesn't fix though |
Not a fluke, but GitHub Python v3.6 seems totally broken today: I've tried 7 times now over the past 12 hrs without success @amotl any advice on this one? Still failing. Not sure if there is GitHub support that can action this. It's strange because it built fine in the rebased pull request being merged. |
Hi Chris, the references to the CI runs you shared show that the builds on PyPy are failing, while the build on Python 3.6.8 succeeds. Can you clarify? Does it still happen? With kind regards, |
Yeah, yeah, tests consistently fail now but for a different reason. It seems pytest just seg faults on startup. It works fine for me, so I'm "guessing" it might be changes on GitHubs side of things. Light they reduced the memory per container? Or perhaps I'm testing with a different version of pytest then the one pulled by GitHub. I haven't had time to investigate |
I just wanted to go ahead and remove testing on GHA for PyPy, if that would fail, but then I inspected GH-854 as a sample, and it looks like every matrix slot actually succeeded? |
I'm seeing core dumps now that don't even begin running at all, eg: https://github.com/caronc/apprise/actions/runs/4754818509/jobs/8448127232 Edit: For your reference to the ticket, the test failing began after that pr. It'll likely pass testing on your personal pc, but die if rebuilt by GitHub now. |
I've submitted GH-868 in order to disable testing on PyPy 3.6 and 3.7 for now. |
Hi again,
while submitting some patches recently, we observed occasional flaky behavior of the test suite on CI. 12. This issue intends to collect references to them, in order to find out about the root cause.
At 2, we discovered
test_plugin_twitter_tweet_attachments
failed on PyPy 3.7 3 with #690. @caronc responded to this with:Thank you for sharing your knowledge here, I will have another look at the test cases related to attachments when I can find some time.
I think it will be fortunate to use the "force-push" variant, in order to keep references to the failed builds on Travis CI, in order to build up more knowledge where and how often this error happens. If you like that approach, feel free to add corresponding references to this issue while we go.
With kind regards,
Andreas.
Footnotes
https://github.com/caronc/apprise/pull/681#issuecomment-1272408168 ↩
https://github.com/caronc/apprise/pull/690#issuecomment-1275036257 ↩ ↩2
https://app.travis-ci.com/github/caronc/apprise/jobs/585326200#L738 ↩
The text was updated successfully, but these errors were encountered: