speedup test_listen_and_serv_op#11126
Merged
Yancey0623 merged 3 commits intoPaddlePaddle:developfrom Jun 4, 2018
Merged
Conversation
velconia
reviewed
Jun 1, 2018
|
|
||
| # raise SIGTERM to pserver | ||
| self._raise_signal(os.getpid(), signal.SIGTERM) | ||
| os.kill(pid, signal.SIGINT) |
Collaborator
There was a problem hiding this comment.
Signal shoule be SIGTERM here
| retry_times = self.ps_timeout | ||
| while True: | ||
| time.sleep(1) | ||
| assert retry_times >= 0, "wait ps ready failed" |
Collaborator
There was a problem hiding this comment.
The assert line and the time.sleep(1) line can be exchanged to detect the timeout ealier
typhoonzero
reviewed
Jun 3, 2018
| # FIXME(Yancey1989): this test would cost much more time on CUDAPlace | ||
| # since load cudnn libraries, so we use a longer timeout to make this | ||
| # unit test stability. | ||
| set_tests_properties(test_listen_and_serv_op PROPERTIES TIMEOUT 30) |
Contributor
There was a problem hiding this comment.
30 seconds is enough for distributed tests?
Contributor
Author
There was a problem hiding this comment.
Yes, in this unit test, pserver would be killed when pserver is ready.
| def _wait_ps_ready(self, pid): | ||
| retry_times = self.ps_timeout | ||
| while True: | ||
| time.sleep(1) |
Contributor
There was a problem hiding this comment.
Can sleep time < 1s and the test will be faster.
Contributor
Author
There was a problem hiding this comment.
Sure, but the pserver would cost about 1 seconds until become ready. BTW, the most time-consuming place is to load and initialize the cuda libraries.
typhoonzero
approved these changes
Jun 4, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed #11127