Skip to content

Commit

Permalink
Added more logging and increased some timeouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
dykstrom committed Apr 26, 2017
1 parent be83f06 commit 458d6ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ private Move findBestMove(Position position, int maxDepth, List<Move> moves, lon
}

if (DEBUG) TLOG.finest(leave(position, 0) + ", score = " + alpha + ", best move = " + bestMove);
TLOG.fine("Returning best move " + bestMove + " with score " + alpha + " for max depth " + maxDepth);
return bestMove;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void setUpChessEngine() throws Exception {
writer = new PrintWriter(process.getOutputStream(), true);

// Wait for the process to start
assertProcessStarted(process, 1000, TimeUnit.MILLISECONDS);
assertProcessStarted(process, 5000, TimeUnit.MILLISECONDS);

// If we failed to start the process
if (!process.isAlive()) {
Expand All @@ -122,7 +122,7 @@ private void setUpChessEngine() throws Exception {
* Tears down the chess engine.
*/
private void tearDownChessEngine() throws Exception {
process.waitFor(1000, TimeUnit.MILLISECONDS);
process.waitFor(5000, TimeUnit.MILLISECONDS);
process.destroy();
}

Expand Down Expand Up @@ -540,10 +540,10 @@ private List<String> readAllInput() throws Exception {

// Assume there will be some input
while (!reader.ready() && process.isAlive()) {
Thread.sleep(1);
Thread.sleep(10);
}
while (reader.ready()) {
Thread.sleep(10);
Thread.sleep(20);
list.add(reader.readLine());
}

Expand Down

0 comments on commit 458d6ef

Please sign in to comment.