summaryrefslogtreecommitdiff
path: root/testsuite/timeout
Commit message (Collapse)AuthorAgeFilesLines
* testsuite/timeout: Fix windows specific errors.Andreas Klebinger2020-10-092-25/+28
| | | | | | | | We now seem to use -Werror there. Which caused some long standing warnings to become errors. I applied changes to remove the warnings allowing the testsuite to run on windows as well.
* Fix typos, via a Levenshtein-style correctorBrian Wignall2020-01-041-1/+1
|
* Adds CTRL-C handler in Windows's timeout (trac issue #12721)ARJANEN Loïc Jean David2018-05-121-23/+32
| | | | | | | | | | | | | | | | | | | Summary: Uses Win32's System.Win32.Console.CtrlHandler.withConsoleCtrlHandler to add to Windows's version of the timeout executable a CTRL-C/CTRL-BREAK handler which does the close IO port/kill job cleanup, just in case. Signed-off-by: ARJANEN Loïc Jean David <arjanen.loic@gmail.com> Reviewers: Phyx, bgamari Reviewed By: Phyx Subscribers: dfeuer, thomie, carter GHC Trac Issues: #12721 Differential Revision: https://phabricator.haskell.org/D4631
* Drop GHC 8.0 compatibilityRyan Scott2018-03-131-3/+0
| | | | | | | | | | | | | | | | GHC 8.4.1 is out, so now GHC's support window only extends back to GHC 8.2. This means we can delete gobs of code that were only used for GHC 8.0 support. Hooray! Test Plan: ./validate Reviewers: bgamari, erikd, dfeuer Reviewed By: bgamari, dfeuer Subscribers: alexbiehl, dfeuer, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4492
* mk/boilerplate.mk defines STAGE1_GHC, not GHC_STAGE1.Edward Z. Yang2017-04-021-1/+1
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Revert "GHC_STAGE1 isn't defined, use other form."Edward Z. Yang2017-03-171-1/+1
| | | | This reverts commit 138434fbef32ec86733747bdbc57f6da73cad500.
* GHC_STAGE1 isn't defined, use other form.Edward Z. Yang2017-03-171-1/+1
| | | | | | | | | | | | | | | | | Summary: I don't really know why this stopped working for me, but it did on a recent clean. I don't know if this is right but it solved the problem for me. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3318
* Fix broken testsPhil Ruffwind2017-01-301-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | 1. DoParamM requires the FlexibleContexts pragma now. 2. topHandler02 and topHandler03 were broken as timeout.py failed to translate signals to exit codes. 3. topHandler03 does not produce a consistent stderr, as it depends on what the user has /bin/sh set to. dash writes "Terminated" whereas bash and zsh produce nothing in non-interactive mode. 4. The remaining tests are broken due to changes in the error message formatting. Test Plan: validate Reviewers: thomie, dfeuer, austin, hvr, bgamari Reviewed By: bgamari Subscribers: Phyx, dfeuer Differential Revision: https://phabricator.haskell.org/D2807
* Bump Win32 version.Ben Gamari2017-01-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | Bump the version of `Win32` to `2.5.0.0` which is a major update and includes fixes for wrong alignments and wrong 64-bit types. Strangely enough this also seems to resolve #12713, where `T10858` was failing due to too-low allocations. The underlying type aliases have changed, so there is a potential for user programs not to compile anymore, but the types were incorrect. This also requires a bump in the `directory`, `Cabal`, and `process` submodules. Original author: Tamar Christina <tamar@zhox.com> Test Plan: ./validate Reviewers: bgamari, RyanGlScott, austin Subscribers: hvr, RyanGlScott, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2938
* Fix various issues with testsuite code on WindowsTamar Christina2016-12-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously we would make direct calls to `diff` using `os.system`. On Windows `os.system` is implemented using the standard idiom `CreateProcess .. WaitForSingleObject ..`. This again runs afoul with the `_exec` behaviour on Windows. So we ran into some trouble where sometimes `diff` would return before it's done. On tests which run multiple ways, such as `8086` what happens is that we think the diff is done and continue. The next way tries to set things up again by removing any previous directory. This would then fail with and error saying the directory can't be removed. Which is true, because the previous diff code/child is still running. We shouldn't make any external calls to anything using `os.system`. Instead just use `runCmd` which uses `timeout`. This also ensures that if we hit the cygwin bug where diff or any other utility hangs, we kill it and continue and not hang the entire test and leave hanging processes. Further more we also: Ignore error lines from `removeFile` from tools in the testsuite. This is a rather large hammer to work around the fact that `hsc2hs` often tries to remove it's own file too early. When this is patched the workaround can be removed. See Trac #9775 We mark `prog003` as skip. Since this test randomly fails and passes. For stability it's disabled but it is a genuine bug which we should find. It's something with interface files being overwritten. See Trac #11317 when `rmtree` hits a readonly file, the `onerror` handler is raised afterwards but not during the tree walk. It doesn't allow you to recover and continue as we thought. Instead you have to explicitly start again. This is why sometimes even though we call `cleanup` before `os.mkdirs`, it would sometimes fail with an error that the folder already exists. So we now do a second walk. A new verbosity level (4) will strip the silent flags from `MAKE` invocations so you can actually see what's going on. Test Plan: ./validate on build bots. Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: mpickering, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2894 GHC Trac Issues: #12661, #11317, #9775
* Expand I/O CP in commentsJoachim Breitner2016-12-271-2/+2
| | | | | as suggested by @gracjan at https://github.com/ghc/ghc/commit/efc4a1661f0fc1004a4b7b0914f3d3a08c2e791a#commitcomment-20284337
* Allow timeout to kill entire process tree.Tamar Christina2016-12-232-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | Summary: we spawn the child processes with handle inheritance on. So they inherit the std handles. The problem is that the job handle gets inherited too. So the `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE` doesn't get used since there are open handles to the job in the children. We then terminate the top level process which is `sh` but leaves the children around. This explicitly disallows the inheritance of the job and events handle. Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2895 GHC Trac Issues: #13004
* Fix timeout's timeout on WindowsTamar Christina2016-12-191-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Timeout has been broken by my previous patch. The timeout event was not being processed correctly, as such hanging processes would not be killed as they should have been. This corrects it. Test Plan: ./validate ~/ghc/testsuite/timeout/install-inplace/bin/timeout.exe 10 "sleep 10000s" Reviewers: austin, RyanGlScott, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2880 GHC Trac Issues: #13004
* Fix x86 Windows build and testsuiteTamar Christina2016-12-061-1/+2
| | | | | | | | | | | | | | | | Summary: Fix issues preventing x86 GHC to build on Windows and fix segfault in the testsuite. Test Plan: ./validate Reviewers: austin, erikd, simonmar, bgamari Reviewed By: bgamari Subscribers: #ghc_windows_task_force, thomie Differential Revision: https://phabricator.haskell.org/D2789
* Fix testsuite threading, timeout, encoding and performance issues on WindowsTamar Christina2016-11-292-13/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a land far far away, a project called Cygwin was born. Cygwin used newlib as it's standard C library implementation. But Cygwin wanted to emulate POSIX systems as closely as possible. So it implemented `execv` using the Windows function `spawnve`. Specifically ``` spawnve (_P_OVERLAY, path, argv, cur_environ ()) ``` `_P_OVERLAY` is crucial, as it makes the function behave *sort of* like execv on linux. the child process replaces the original process. With one major difference because of the difference in process models on Windows: the original process signals the caller that it's done. this is why the file is still locked. because it's still running, control was returned because the parent process was destroyed, but the child is still running. I think it's just pure dumb luck, that the older runtimes are slow enough to give the process time to terminate before we tried deleting the file. Which explains why you do have sporadic failures even on older runtimes like 2.5.0, of a test or two (like T7307). So this patch fixes a couple of things. I leverage the existing `timeout.exe` to implement a workaround for this issue. a) The old timeout used to start the process then assign it to the job. This is slightly faulty since child processes are only assigned to a job is their parent were assigned at the time they started. So this was a race condition. I now create the process suspended, assign it to the job and then resume it. Which means all child processes are not running under the same job. b) First things, Is to prevent dangling child processes. I mark the job with `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE` so when the last process in the job is done, it insures all processes under the job are killed. c) Secondly, I change the way we wait for results. Instead of waiting for the parent process to terminate, I wait for the job itself to terminate. There's a slight subtlety there, we can't wait on the job itself. Instead we have to create an I/O Completion port and wait for signals on it. See https://blogs.msdn.microsoft.com/oldnewthing/20130405-00/?p=4743 This fixes the issues on all runtimes for me and makes T7307 pass consistenly. The threading was also simplified by hiding all the locking in a single semaphore and a completion class. Futhermore some additional error reporting was added. For encoding the testsuite now no longer passes a file handle to the subprocess since on windows, sh.exe seems to acquire a lock on the file that is not released in a timely fashion. I suspect this because cygwin seems to emulate console handles by creating file handles and using those for std handles. So when we give it an existing file handle it just locks the file. I what's happening is that it's not releasing the handle until all shared cygwin processes are dead. Which explains why it worked in single threaded mode. So now instead we pass a pipe and do not interpret the resulting data. Any bytes written to stdin or read out of stdout/stderr are done so in binary mode and we do not interpret the data. The reason for this is that we have encoding tests in GHC which pass invalid utf-8. If we try to handle the data as text then python will throw an exception instead of a test comparison failing. Also I have fixed the ability to override `PYTHON` when calling `make tests`. This now works the same as with `.\validate`. Finally, after cleaning up the locks I was able to make the abort behavior work correctly as I believe it was intended: when you press Ctrl+C and send an interrupt signal, the testsuite finishes the active tests and then gracefully exits showing you a report of the progress it did make. So using Ctrl+C will not just *die* as it did before. These changes lift the restriction on which python version you use (msys/mingw) or which runtime or python 3 or python 2. All combinations should now be supported. Test Plan: PATH=/usr/local/bin:/mingw64/bin:$APPDATA/cabal/bin:$PATH && PYTHON=/usr/bin/python THREADS=9 make test THREADS=9 make test PATH=/usr/local/bin:/mingw64/bin:$APPDATA/cabal/bin:$PATH && PYTHON=/usr/bin/python ./validate --quiet --testsuite-only Reviewers: erikd, RyanGlScott, bgamari, austin Subscribers: jrtc27, mpickering, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2684 GHC Trac Issues: #12725, #12554, #12661, #12004
* testsuite/timeout: Ensure that processes are cleaned up on WindowsBen Gamari2016-10-171-16/+19
| | | | | | | | | | | | | | Previously if the test is interrupted (e.g. with Ctrl-C) any processes which it spawned may not be properly terminated. Here we catch any exception and ensure that we job is terminated. Test Plan: Validate on Windows Reviewers: Phyx, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2599
* Testsuite: do not print timeout messageThomas Miedema2016-06-281-6/+1
| | | | | This is a followup to e1293bbfb1fa1fdeb56446a7b957d6f628042e71, but then for Windows timeout.
* Testsuite: only print msg when timeout kills process unexpectedlyThomas Miedema2015-09-041-2/+0
| | | | Differential Revision: https://phabricator.haskell.org/D1207
* testsuite: Show killed command line on timeoutBen Gamari2015-07-212-5/+6
|
* Build system: prevent "./Setup: Command not found"Thomas Miedema2015-05-301-1/+1
| | | | [skip ci]
* Python 3 support, second attempt (Trac #9184)Krzysztof Gogolewski2014-10-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a fixup of https://phabricator.haskell.org/D233 The only difference is in findTFiles (first commit), which previously broke Windows runner; now I translated literally instead attempting to improve it, and checked it works. Test Plan: I used validate under 2,3 on Linux and under 2 on msys2. On Windows I've seen a large number of failures, but they don't seem to be connected with the patch. Reviewers: hvr, simonmar, thomie, austin Reviewed By: austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D310 GHC Trac Issues: #9184
* Revert "Basic Python 3 support for testsuite driver (Trac #9184)"Krzysztof Gogolewski2014-10-032-2/+2
| | | | | | This reverts commit 084d241b316bfa12e41fc34cae993ca276bf0730. This is a possible culprit of Windows breakage reported at ghc-devs.
* Basic Python 3 support for testsuite driver (Trac #9184)Krzysztof Gogolewski2014-10-012-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Most of the changes is adaptation of old Python 2 only code. My priority was not breaking Python 2, and so I avoided bigger changes to the driver. In particular, under Python 3 the output is a str and buffering cannot be disabled. To test, define PYTHON=python3 in testsuite/mk/boilerplate.mk. Thanks to aspidites <emarshall85@gmail.com> who provided the initial patch. Test Plan: validate under 2 and 3 Reviewers: hvr, simonmar, thomie, austin Reviewed By: thomie, austin Subscribers: aspidites, thomie, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D233 GHC Trac Issues: #9184
* Remove the definition of die, which is now provided by System.ExitSimon Peyton Jones2014-04-281-4/+0
|
* Handle ^C better when threads are being used tooIan Lynagh2013-02-021-39/+46
|
* Fix the timeout program following the changes to baseIan Lynagh2012-06-201-2/+0
|
* Don't read boilerplate.mk on 'make maintainer-clean'Simon Peyton Jones2012-01-201-0/+2
|
* cleaning of testsuiteDavid Terei2011-11-154-11/+7
|
* Fix passing spaces to tests on Windows, and add a test for itIan Lynagh2011-10-181-2/+6
|
* Fix quoting in MakefileIan Lynagh2010-04-161-1/+1
|
* Use ${PYTHON} instead of relying on #!/usr/bin/env pythonMatthias Kilian2010-04-161-1/+3
|
* Always use the python timeout program on non-WindowsIan Lynagh2009-10-251-1/+6
| | | | | | | | | Use a python timeout program, so that we don't have to worry about whether or not the compiler we're testing has built the timeout program correctly The python timeout program doesn't work on mingw, so we still use the Haskell program on Windows
* Complete timeout.py's unix supportIan Lynagh2009-10-251-2/+19
|
* Fix quoting in the testsuite timeout program's MakefileIan Lynagh2009-10-131-7/+7
|
* Add some diagnostics to timeoutIan Lynagh2009-10-131-3/+9
|
* Use /usr/bin/env to find PythonSimon Marlow2009-07-232-2/+2
| | | | Contributed by: Krister Walfridsson <krister.walfridsson@gmail.com>
* make maintainer-clean workSimon Marlow2009-05-141-1/+1
|
* Tell Cabal where hsc2hs; fixes trac #3147Ian Lynagh2009-04-101-0/+1
| | | | Patch from gwright.
* Do not use System.Process on Posix systemsSimon Marlow2008-12-221-27/+27
| | | | | | We were using System.Process.Internals, which isn't safe in general. Also, when the child process dies with a signal, we now raise the same signal ourselves.
* Hack to find gcc for an in-place ghcIan Lynagh2009-01-161-1/+7
|
* Also canonicalise the install prefix for the timeout programIan Lynagh2009-01-161-1/+4
|
* Move the Makefile changes around so they don't cause test failuresIan Lynagh2009-01-141-0/+12
| | | | | Our "make clean" detection was causing problems for tests which had their own local clean target.
* Fix timeout's clean targetIan Lynagh2009-01-091-1/+2
|
* Disentangle the testsuite from the compiler's build systemIan Lynagh2009-01-083-51/+17
|
* Make the testsuite work with the new build systemSimon Marlow2008-12-171-0/+41
|
* follow library changesIan Lynagh2008-09-031-1/+1
|
* We now depend on concurrent (split off from base)Ian Lynagh2008-08-241-1/+1
|
* Change the timeout program to use exceptions properlyIan Lynagh2008-08-031-19/+30
| | | | We now don't eat any type of exception, e.g. the user pressing ^C
* Follow extensible exception changesIan Lynagh2008-06-231-6/+7
|
* Don't fail when cleaning if cabal-bin doesn't existIan Lynagh2008-07-291-1/+1
|