RequestHandlerTestHarness improvements

Description

RequestHandlerTestHarness has a sophisticated component called CapturingTimer that allows to capture a timeout set by a handler so that test code can make assertions on it.

However the capture of a timeout and its retrieval with nextScheduledTimeout() oftentimes happen in different threads, which is why the component stores timeouts in a queue and then retrieves them with timeoutQueue.poll(100, TimeUnit.MILLISECONDS).

It happens sometimes that the poll operation above times out and returns null, usually causing a NullPointerException in test code.

A better approach would be to get rid of this poll operation completely, if possible. If not possible, we should at least consider raising the poll timeout to a bit more than 100 milliseconds.

Environment

None

Pull Requests

None

Status

Assignee

Alexandre Dutra

Reporter

Alexandre Dutra

Labels

None

PM Priority

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Minor
Configure