Skip to content

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
public abstract class LoadTask<V> implements Runnable {

private static final Logger LOG = LoggerFactory.getLogger(LoadTask.class);
public static final String LOAD_TASK_ERROR_FORMAT = "Exception while running %s: %s";
Copy link

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

Choose a reason for hiding this comment

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

duplicate

}
}


Copy link

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

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

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

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

### Changed:

- [Added mandatory logging for LoadTask errors]
Copy link

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

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

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

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
@ghost ghost added NEED 1 REVIEW and removed NEED 2 REVIEWS labels Oct 20, 2017
@ghost ghost added the NEED REBASE label Oct 28, 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
@ghost ghost added the NEED REBASE label Nov 7, 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