log-bwd-multiple-msgs.phpt 972 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --TEST--
  2. FPM: Buffered worker output decorated log with multiple continuous messages
  3. --SKIPIF--
  4. <?php include "skipif.inc"; ?>
  5. --FILE--
  6. <?php
  7. require_once "tester.inc";
  8. $cfg = <<<EOT
  9. [global]
  10. error_log = {{FILE:LOG}}
  11. [unconfined]
  12. listen = {{ADDR}}
  13. pm = dynamic
  14. pm.max_children = 5
  15. pm.start_servers = 1
  16. pm.min_spare_servers = 1
  17. pm.max_spare_servers = 3
  18. catch_workers_output = yes
  19. EOT;
  20. $code = <<<EOT
  21. <?php
  22. file_put_contents('php://stderr', "msg 1 - ");
  23. usleep(1);
  24. file_put_contents('php://stderr', "msg 2 - ");
  25. usleep(1);
  26. file_put_contents('php://stderr', "msg 3");
  27. EOT;
  28. $tester = new FPM\Tester($cfg, $code);
  29. $tester->start();
  30. $tester->expectLogStartNotices();
  31. $tester->request()->expectEmptyBody();
  32. $tester->request()->expectEmptyBody();
  33. $tester->expectLogLine('msg 1 - msg 2 - msg 3');
  34. $tester->expectLogLine('msg 1 - msg 2 - msg 3');
  35. $tester->terminate();
  36. $tester->close();
  37. ?>
  38. Done
  39. --EXPECT--
  40. Done
  41. --CLEAN--
  42. <?php
  43. require_once "tester.inc";
  44. FPM\Tester::clean();
  45. ?>