Skip to content

Commit f215a78

Browse files
author
yi.wu
committed
add script
1 parent 9af0334 commit f215a78

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

python/paddle/fluid/tests/unittests/test_listen_and_serv_op.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,13 @@ def test_handle_signal_in_serv_op(self):
9292
pid = self._start_pserver(False, True)
9393
self._wait_ps_ready(pid)
9494

95-
print("send kill signal, ", pid)
9695
# raise SIGTERM to pserver
9796
os.kill(pid, signal.SIGTERM)
9897

9998
# run pserver on CPU in async mode
10099
pid = self._start_pserver(False, False)
101100
self._wait_ps_ready(pid)
102101

103-
print("send kill signal, ", pid)
104102
# raise SIGTERM to pserver
105103
os.kill(pid, signal.SIGTERM)
106104

tools/check_ctest_hung.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import sys
16+
import re
17+
18+
19+
def escape(input):
20+
o = input.replace("\n", "")
21+
o = o.replace("\r", "")
22+
return o
23+
24+
25+
def main():
26+
logfile = sys.argv[1]
27+
started = set()
28+
passed = set()
29+
with open(logfile, "r") as fn:
30+
for l in fn.readlines():
31+
if l.find("Test ") != -1 and \
32+
l.find("Passed") != -1:
33+
m = re.search("Test\s+#[0-9]*\:\s([a-z0-9_]+)", escape(l))
34+
passed.add(m.group(1))
35+
if l.find("Start ") != -1:
36+
start_parts = escape(l).split(" ")
37+
m = re.search("Start\s+[0-9]+\:\s([a-z0-9_]+)", escape(l))
38+
started.add(m.group(1))
39+
print "Diff: ", started - passed
40+
41+
42+
if __name__ == "__main__":
43+
main()

0 commit comments

Comments
 (0)