Make non-mocked message publishing fail when running tests in bcd environment
AdamWill opened this issue · 1 comments
Working on #5630 made me realize that, when running tests in the bcd environment, non-mocked attempts to publish messages 'work', silently and speedily. This is a problem, because they don't do that in the CI environment. They take a very long time and eventually time out; this doesn't usually cause the test to fail, but there is a 30 minute time limit so if you have more than a couple of cases of this, the tests will time out (and obviously we don't want even one, really).
Ideally, we should find a clean way to make non-mocked message publish attempts fail when testing - without breaking message publishing in the bodhi development environment itself. This may not be possible, but hey, we can try.
I don't think we can do this by fiddling with Bodhi's notifications.py
because the tests frequently use fedora-messaging's own mock_sends
convenience thingy, which requires us to publish 'as normal' all the way out to fedora-messaging. If you e.g. mock out _publish_with_retry
, a lot of the tests fail because of this.
I found a dirty way to make 'real' publishing fail - edit fedora_messaging/api.py
in the bcd env and make twisted_publish
immediately raise an exception when called. That's the hack I used to find all the cases in #5630 and fix them. But that's obviously not something we can bake in.