Open programarivm opened 1 year ago
Hi @programarivm, you're buffering the socket contents until the socket closes, but the socket is likely not closed in that test, so the test hangs.
Hi @programarivm!
Amp\ByteStream\buffer()
waits until the stream has closed to return the buffered content. Are you expecting $socket
to have closed after the response is received? If not, rather than buffer()
you'll want to consider reading in loop until the expected payload is received, using Amp\ByteStream\BufferedReader
, or if the JSON is line-delimited, you may be able to use Amp\ByteStream\parseLineDelimitedJson()
.
If the above isn't the issue, I can pull the repos and investigate further.
Thank you @kelunik and @trowski for the help.
Not too sure about this one yet. No worries, I suppose for the time being the Selenium automated tests will be kind of equivalent to the so-called functional tests.
👋 Hi there,
At ChesslaBlab we're writing functional tests for the PHP Chess Server.
See:
At this moment I'm trying to run the docs example as it is shown in the two images below.
Figure 1. php cli/testing.php
Figure 2. vendor/bin/phpunit tests/functional/
However, the test is left waiting indefinitely.
Also this is the cli/testing.php script running the TCP socket server on port 8080 shown in Figure 1.
Any help would be greatly appreciated.
Thank you,