Skip to content

Commit

Permalink
invoke setRunner method in ConcurrentServerRunner so that Instrumente…
Browse files Browse the repository at this point in the history
…dConcurrentServerRunner's overriden impl can be used in tests
  • Loading branch information
ceki committed May 1, 2013
1 parent 91b953a commit d155727
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -129,7 +129,7 @@ private Collection<T> copyClients() {
* {@inheritDoc}
*/
public void run() {
running = true;
setRunning(true);
try {
addInfo("listening on " + listener);
while (!Thread.currentThread().isInterrupted()) {
Expand All @@ -155,7 +155,7 @@ public void run() {
addError("listener: " + ex);
}

running = false;
setRunning(false);
addInfo("shutting down");
listener.close();
}
Expand Down
Expand Up @@ -61,7 +61,7 @@ public void tearDown() throws Exception {
public void testStartStop() throws Exception {
assertFalse(runner.isRunning());
executor.execute(runner);
assertTrue(runner.awaitRunState(true, SHORT_DELAY));
assertTrue(runner.awaitRunState(true, DELAY));
int retries = DELAY / SHORT_DELAY;
synchronized (listener) {
while (retries-- > 0 && listener.getWaiter() == null) {
Expand Down

1 comment on commit d155727

@ceharris
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch!

Please sign in to comment.