-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add timeout for starting tarantool server #302
Add timeout for starting tarantool server #302
Conversation
5864c82
to
7135e26
Compare
1d40f4e
to
25bbb47
Compare
@VitaliyaIoffe could you rebase to master? Latest changes includes code coverage measurement and it would be interesting how code coverage numbers are changed with your tests. |
f612ae4
to
241b0d8
Compare
68d3d41
to
2a374c7
Compare
When a tarantool server starts, it waits for a special pattern in the log file to proceed. If there is no pattern present, the server hangs. After the test timeout (TEST_TIMEOUT) runs out, the test fails. This patch adds the `--server-start-timeout` option to test-run (by default it equals to 90 seconds). Now when the server hangs and the time (SERVER_START_TIMEOUT) runs out, a comprehensible exception is raised with the message that the server failed to start within the timeout. Fixes: #276
It was found that processes of non-started tarantool servers are not killed by test-run and leave to hang. This situation can be reproduced by creating the main server, then creating a replica server, but the replica server is unable to join the master, for example, due to lack of user permissions. In this case, the test fails by the server start timeout and test-run kills the main server process only. This patch fixes the issue. Fixes #256 Follows up #276
2a374c7
to
03d260a
Compare
It is not possible. The test checks that a process of a non-started tarantool server will not hang and will be killed after server start timeout runs out. The problem with hanging processes of non-started tarantool servers was resolved in the |
03d260a
to
37bd48f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing (cherry picked from commit 0b46154)
Bump test-run to new version with the following improvements: - Add timeout for starting tarantool server (tarantool/test-run#302) - Kill hanging processes of not started servers (tarantool/test-run#332) - Rerun all failed tests, not only marked as fragile (tarantool/test-run#329) NO_DOC=testing NO_TEST=testing NO_CHANGELOG=testing (cherry picked from commit 0b46154)
This patch includes 4 commits:
Use gevent sleep for switching context
time.sleep
was changed togevent.sleep
to allow current greenlet tosleep and others to run. When
time.sleep
is used, greenlet's contextis not changed from the main process to test's greenlet.
As a result of this, there is no data received by the main process while
hanging the tarantool server process and the test is fallen down by the
common timeout (NO_OUTPUT_TIMEOUT). Even worse, the tarantool server
process is not killed by test-run.
Using
gevent.sleep
makes the test fail by the test timeout and killthe farantool server process.
Part of #276
Add timeout for starting tarantool server
When a tarantool server starts, it waits for a special pattern in the
log file to proceed. If there is no pattern present, the server hangs.
After the test timeout (TEST_TIMEOUT) runs out, the test fails.
This patch adds the
--server-start-timeout
option to test-run (bydefault it equals to 90 seconds). Now when the server hangs and the
time (SERVER_START_TIMEOUT) runs out, a comprehensible exception is
raised with the message that the server failed to start within the
timeout.
Fixes: #276
Kill processes of non-started tarantool servers
It was found that processes of non-started tarantool servers are not
killed by test-run and leave to hang. This situation can be reproduced
by creating the main server, then creating a replica server, but the
replica server is unable to join the master, for example, due to lack
of user permissions. In this case, the test fails by the server start
timeout and test-run kills the main server process only.
Fixes #256
Follows up #276
Add unit test checking no hanging procs present
This patch adds a simple unit test checking that if a tarantool server
failed to start within a certain amount of seconds, test-tun raises a
comprehensible exception and kills the server process.
Follows up #256
Follows up #276