Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically test if the sandbox can show up #106

Open
chunhualiao opened this issue Jun 8, 2020 · 1 comment
Open

automatically test if the sandbox can show up #106

chunhualiao opened this issue Jun 8, 2020 · 1 comment
Assignees

Comments

@chunhualiao
Copy link
Owner

Right now we have to manually check if the sandbox can show up when a tutorial is openned.

Ideally, we should test this automatically and be the first to know if our sandbox has problems. There are some online site availability testing tools. If a site/URL is not available , they will send out email notifications.

Can you take a look if we can leverage them?

@ouankou
Copy link
Collaborator

ouankou commented Aug 13, 2020

The following command can be used to test a websocket connection in FreeCC.
It connects the socket for 2s and disconnects automatically.

curl --include \
     --no-buffer \
     --max-time 2 \
     --header "Connection: Upgrade" \
     --header "Upgrade: websocket" \
     --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
     --header "Sec-WebSocket-Version: 13" \
     http://lab.freecompilercamp.org:5010/sessions/bsqkfeoq4uig0s27i4q0/ws/

If a sandbox works, the following welcome message should be shown.
fcc_success

Otherwise, it either shows nothing or other unexpected message.
fcc_fail

By checking the output via grep, we can know whether the docker container works correctly.

We can either run a cron job to test FreeCC on our server periodically, or develop an app on some cloud service, such as Heroku, to monitor FreeCC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants