Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Ignore job failures #66

Merged
merged 7 commits into from Jan 7, 2017
Merged

Ignore job failures #66

merged 7 commits into from Jan 7, 2017

Conversation

davetron5000
Copy link
Contributor

Problem

When we cannot connect to Redis, which is frequent with RedisCloud, the monitoring jobs fail. Since they are run periodically, there's no sense retrying them, so we end up with a lot of grinding.

Solution

Add option to log and ignore them.

Addendum

MonitorJob had no test coverage, and adding it was tricky because it relies on a lot of global state. Thus, I sadly had to introduce a mocking library in order to get test coverage. With that coverage, I refactored the class to not create every single checker and notifier every single time, instead only creating what is needed. This change isn't strictly needed for this, but it allowed the tests to be a lot easier to deal with.

end

class MonitorJobTest < MiniTest::Test
include Mocha::API
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For whatever reason, the Mocha setup instructions differ from the code and neither works enough to set up Mocha in the tests properly, so it seems I have to do all this manually. Which is fine—I'd like to keep mocking at a minimum

@davetron5000 davetron5000 merged commit 53f3ac9 into master Jan 7, 2017
@davetron5000 davetron5000 deleted the ignore-job-failures branch January 7, 2017 17:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant