Skip to content

Conversation

hug-dev
Copy link
Member

@hug-dev hug-dev commented Sep 30, 2021

This commit changes the CI script to start Parsec Mock there. Moves the
ping test from the already existing mock interface to Parsec Mock.

In the future the tests in src/core/testing can be added in the Parsec Mock repo and used from the mock_service.rs test file. That way the test cases can benefit all clients.

@hug-dev hug-dev added the testing Task related to testing label Sep 30, 2021
@hug-dev hug-dev force-pushed the use-parsec-mock branch 4 times, most recently from 77f4680 to f66746d Compare October 1, 2021 13:28
@ionut-arm
Copy link
Member

I've investigated a bit, it seems the failures are pretty much random, couldn't rat out the exact cause. Most of my testing so far has been around whether the socket exists, as the client seems to get a connection error and I was expecting it to be due to a delay in the mock service. But even when I made sure to wait until the socket exists (and then some more), failures still occured. I can't tell what exactly is happening, as locally I've not been able to reproduce the error. My only idea for now is to just move the testing into a container and hope that solves it.

@ionut-arm ionut-arm force-pushed the use-parsec-mock branch 3 times, most recently from 1e7ac10 to 4b0e202 Compare October 8, 2021 10:12
@ionut-arm
Copy link
Member

Ok, the problem here seems to be in the mock service - because of the way recv works in Python on Unix Domain Sockets, it simply returns as soon as it gets something from the connection. If the client isn't fast enough, the service reads the first few bytes of the request and tries to work with that as a full request, which it isn't, so it closes the connection.

The fix, therefore, needs to make sure the mock service keeps polling the connection until it gets no bytes and hits a timeout. Will update this PR once I get that merged.

@hug-dev
Copy link
Member Author

hug-dev commented Oct 10, 2021

Wow, nice find!

I am wondering why the logs of the service do not show the following line though?

print("Received unexpected request {}".format(b64_received_data))

@ionut-arm
Copy link
Member

I am wondering why the logs of the service do not show the following line though?

print("Received unexpected request {}".format(b64_received_data))

It's because when it runs in a non-interactive shell the flushes seem to occur much less frequently.

This commit changes the CI script to start Parsec Mock there. Moves the
ping test from the already existing mock interface to Parsec Mock.

Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
@hug-dev
Copy link
Member Author

hug-dev commented Oct 17, 2021

Can't approve my own PR but this looks good 👌 Thanks for debugging this out.

After the mock service is started, we should wait until the socket it
opens becomes available.

Signed-off-by: Ionut Mihalcea <ionut.mihalcea@arm.com>
@@ -33,7 +33,9 @@ fi
CURRENT_PATH=$(pwd)
cd parsec-mock-0.1.1
python parsec_mock/parsec_mock.py --parsec-socket $CURRENT_PATH/parsec_mock.sock &
sleep 5
while [[ ! -S $CURRENT_PATH/parsec_mock.sock ]]; do
sleep 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would got for 1sec, but it's not important

@ionut-arm ionut-arm merged commit 8da6dde into parallaxsecond:main Oct 18, 2021
@ionut-arm ionut-arm deleted the use-parsec-mock branch October 18, 2021 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Task related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants