Skip to content
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

Implementing mandatory uncaught exception logging on loader tasks. #553

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

michael-mclawhorn
Copy link
Contributor

Adding error logging on loader tasks.

@michael-mclawhorn michael-mclawhorn force-pushed the ForcingExceptionHandlingOnLoadTasks branch from 4afdf96 to 6e29923 Compare October 16, 2017 22:12
@yahoo yahoo deleted a comment Oct 16, 2017
@yahoo yahoo deleted a comment Oct 16, 2017
private static final Logger LOG = LoggerFactory.getLogger(LoadTask.class);
public static final String LOAD_TASK_ERROR_FORMAT = "Exception while running %s: %s";
Copy link
Contributor

Choose a reason for hiding this comment

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

Move it to ErrorMessageFormat?



def "Test error gets logged on failed test"() {
setup:
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicate

}
}


Copy link
Contributor

Choose a reason for hiding this comment

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

remove extra line

def "Test error gets logged on failed test"() {
setup:
setup: "Instantiate a task scheduler"
ObjectMapper MAPPER = new ObjectMappersSuite().getMapper()
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like MAPPER is unused

setup: "Instantiate a task scheduler"
ObjectMapper MAPPER = new ObjectMappersSuite().getMapper()


Copy link
Contributor

Choose a reason for hiding this comment

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

Remove extra line


class FailingTestLoadTask extends LoadTaskSpec.OneOffTestLoadTask {


Copy link
Contributor

Choose a reason for hiding this comment

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

Remove extra line

CHANGELOG.md Outdated
@@ -74,6 +74,11 @@ Current


### Changed:

- [Added mandatory logging for LoadTask errors]
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing PR link


TaskScheduler scheduler = new TaskScheduler(2)
LoadTask<Boolean> loader = new FailingTestLoadTask(expectedDelay)
loader.setFuture(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can unwrap

scheduler.schedule(
loader,
1,
TimeUnit.MILLISECONDS
Copy link
Contributor

Choose a reason for hiding this comment

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

Can unwrap


expect:
loader.failed
logAppender.getMessages().find { it.contains(/UNIQUE_VALUE_1/) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Change "UNIQUE_VALUE_1" to FailingTestLoadTask.UNIQUE_VALUE_1 for better maintainability?

@yahoo yahoo deleted a comment Oct 19, 2017
@yahoo yahoo deleted a comment Oct 19, 2017
@michael-mclawhorn michael-mclawhorn force-pushed the ForcingExceptionHandlingOnLoadTasks branch from a8006ad to 8a56af3 Compare October 31, 2017 20:22
@yahoo yahoo deleted a comment Oct 31, 2017
@yahoo yahoo deleted a comment Oct 31, 2017
@michael-mclawhorn michael-mclawhorn force-pushed the ForcingExceptionHandlingOnLoadTasks branch from 8a56af3 to 46a55a5 Compare February 2, 2018 17:46
@yahoo yahoo deleted a comment Feb 2, 2018
@yahoo yahoo deleted a comment Feb 2, 2018
Copy link
Member

@kevinhinterlong kevinhinterlong left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants