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

Make Kompos tests more robust, include more info in failures, and use ephemeral ports if necessary #144

Merged
merged 4 commits into from
May 6, 2017

Conversation

smarr
Copy link
Owner

@smarr smarr commented May 4, 2017

Kompos tests are sometimes failing on Travis because the old server is still running/shutting down.
So, there is some race.
One problem might be that there is a reuse timeout.

If there is no other race/promise not handled correctly, we might need to look into using: setReuseAddress(true) on the socket.

Instead of using setReuseAddress(true), I am switching to using ephemeral ports, i.e., random ports when the normal ones are in use.
The port numbers are reported in standard out and are parsed out by the tests.
In the frontend code, I am using a JSON request to retrieve them via HTTP.

@smarr smarr added bug Fixes an issue, incorrect implementation enhancement Improves the implementation with something noteworthy labels May 4, 2017
@smarr smarr added this to the v0.4.0 milestone May 4, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 79.786% when pulling 25a15b9 on kompos-tests into 3ed3c17 on master.

smarr added 3 commits May 6, 2017 22:02
- add SOMns output to error
- properly reject some of the promises
- report error with stderr out when stream closes
- added SOMns process kill
- add shutdown hook to close sockets
- wait until process exit with failing test

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Kompos tests fail on travis some times with an address already bound error.
To avoid it, try to use standard port, and if already in use, use an ephemeral port instead.
The web socket ports can be communicated via JSON and easily queried by the frontend.
The HTTP port needs to be parsed out of the STDOUT.

- update SOMns-deps to have latest WebSocket lib version
- in tests, parse stdout for ports
- remove duplicate code of old BinaryWebSocketHandler

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
@coveralls
Copy link

Coverage Status

Coverage remained the same at 79.786% when pulling d15a6d9 on kompos-tests into 3ed3c17 on master.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
@smarr smarr changed the title Make Kompos tests more robust, and include more info in failures Make Kompos tests more robust, include more info in failures, and use ephemeral ports if necessary May 6, 2017
@smarr smarr merged commit 9ef1f72 into master May 6, 2017
@smarr smarr deleted the kompos-tests branch May 6, 2017 20:30
@coveralls
Copy link

Coverage Status

Coverage remained the same at 79.786% when pulling cecb092 on kompos-tests into 3ed3c17 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes an issue, incorrect implementation enhancement Improves the implementation with something noteworthy
Projects
No open projects
MetaConc
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants