add timeout env variable for tests with slow/heavy load machines (travisCI)

pull/2/head
toimtoimtoim 8 years ago
parent f4bd2dee3c
commit 5e8b3159a3
  1. 4
      tests/ModbusMaster/MockServerTestCase.php

@ -23,10 +23,10 @@ abstract class MockServerTestCase extends TestCase
$clientData[] = $output;
});
if (strpos(PHP_OS, 'WIN') === false) {
if (strpos(PHP_OS, 'WIN') === false || getenv('MOCKSERVER_TIMEOUT_USEC') !== false) {
// wait to spin up. needed for linux. unnessecary on Windows 10.
// Ugly but even with 150ms sleep test run faster on Linux
usleep(150000);
usleep(getenv('MOCKSERVER_TIMEOUT_USEC') ?: 150000);
}
$closure($port);
});

Loading…
Cancel
Save