I have a feeling that your server is keeping the connection open after emitting the response for the
TESTBED command. Thus, the call
$t->getlines is terminating only because it is timing out, and with the timeout set to 1500 seconds, it's going to take that long for it to return. You probably will have to develop a test to tell when the server is finished with the
TESTBED command and do something like:
while (defined($_ = $t->getline)) {
last if (...test for end of response...);
push(@ok, $_);
}