Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,331
Issues
4,331
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
370
Merge Requests
370
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
f519cb55
Commit
f519cb55
authored
Jul 21, 2015
by
Ben Gamari
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testsuite: Show killed command line on timeout
parent
35eb736b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
testsuite/timeout/timeout.hs
testsuite/timeout/timeout.hs
+4
-4
testsuite/timeout/timeout.py
testsuite/timeout/timeout.py
+2
-1
No files found.
testsuite/timeout/timeout.hs
View file @
f519cb55
...
...
@@ -33,8 +33,8 @@ main = do
_
->
die
(
"Can't parse "
++
show
secs
++
" as a number of seconds"
)
_
->
die
(
"Bad arguments "
++
show
args
)
timeoutMsg
::
String
timeoutMsg
=
"Timeout happened...killing process
..."
timeoutMsg
::
String
->
String
timeoutMsg
cmd
=
"Timeout happened...killing process "
++
cmd
++
"
..."
run
::
Int
->
String
->
IO
()
#
if
!
defined
(
mingw32_HOST_OS
)
...
...
@@ -61,7 +61,7 @@ run secs cmd = do
r
<-
takeMVar
m
case
r
of
Nothing
->
do
hPutStrLn
stderr
timeoutMsg
hPutStrLn
stderr
(
timeoutMsg
cmd
)
killProcess
pid
exitWith
(
ExitFailure
99
)
Just
(
Exited
r
)
->
exitWith
r
...
...
@@ -122,7 +122,7 @@ run secs cmd =
let
millisecs
=
secs
*
1000
rc
<-
waitForSingleObject
handle
(
fromIntegral
millisecs
)
if
rc
==
cWAIT_TIMEOUT
then
do
hPutStrLn
stderr
timeoutMsg
then
do
hPutStrLn
stderr
(
timeoutMsg
cmd
)
terminateJobObject
job
99
exitWith
(
ExitFailure
99
)
else
alloca
$
\
p_exitCode
->
...
...
testsuite/timeout/timeout.py
View file @
f519cb55
...
...
@@ -35,7 +35,8 @@ try:
else
:
# parent
def
handler
(
signum
,
frame
):
sys
.
stderr
.
write
(
'Timeout happened...killing process...
\n
'
)
msg
=
'Timeout happened...killing process %s...
\n
'
%
cmd
sys
.
stderr
.
write
(
msg
)
killProcess
(
pid
)
sys
.
exit
(
99
)
old
=
signal
.
signal
(
signal
.
SIGALRM
,
handler
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment