diff options
author | Tom Sydney Kerckhove <syd@fpcomplete.com> | 2017-10-25 08:09:35 +0100 |
---|---|---|
committer | Tamar Christina <tamar@zhox.com> | 2017-10-25 08:23:26 +0100 |
commit | 3825b7e222bc1b7d643fce0755cf6b728fb1d854 (patch) | |
tree | c2f32cfb343f332dd73889c9f3a9adaa91bdb524 /libraries/base/tests | |
parent | 8843a39b3c941b1908a8d839f52bc323f3b45081 (diff) | |
download | haskell-3825b7e222bc1b7d643fce0755cf6b728fb1d854.tar.gz |
Remove the 'legroom' part of the timeout-accurate-pure test.
Summary:
This removes the part of the test that checks whether the timeout happened in
a 'reasonable' amount of time, because it is flaky.
In subsequent work, we can turn this into a benchmark.
Test Plan: This _is_ a test
Reviewers: nh2, bgamari, Phyx, austin, hvr
Reviewed By: Phyx
Subscribers: rwbarton, thomie
GHC Trac Issues: #8684
Differential Revision: https://phabricator.haskell.org/D4120
Diffstat (limited to 'libraries/base/tests')
-rw-r--r-- | libraries/base/tests/all.T | 1 | ||||
-rw-r--r-- | libraries/base/tests/timeout-accurate-pure.hs | 28 | ||||
-rw-r--r-- | libraries/base/tests/timeout-accurate-pure.stdout | 2 |
3 files changed, 0 insertions, 31 deletions
diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index a1eba6a465..9055bd5b45 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -190,7 +190,6 @@ test('T8089', [exit_code(99), run_timeout_multiplier(0.01)], compile_and_run, ['']) test('T8684', expect_broken(8684), compile_and_run, ['']) -test('timeout-accurate-pure', normal, compile_and_run, ['']) test('T9826',normal, compile_and_run,['']) test('T9848', [ stats_num_field('bytes allocated', diff --git a/libraries/base/tests/timeout-accurate-pure.hs b/libraries/base/tests/timeout-accurate-pure.hs deleted file mode 100644 index a59e785a01..0000000000 --- a/libraries/base/tests/timeout-accurate-pure.hs +++ /dev/null @@ -1,28 +0,0 @@ -import Control.Concurrent -import Control.Monad -import GHC.Clock -import System.IO -import System.Timeout - -ack :: Integer -> Integer -> Integer -ack 0 n = n + 1 -ack m 0 = ack (m - 1) 1 -ack m n = ack (m - 1) (ack m (n - 1)) - -main :: IO () -main = do - let microsecondsPerSecond = 1000 * 1000 - let timeToSpend = 1 * microsecondsPerSecond -- One second in microseconds - start <- getMonotonicTimeNSec - timeout timeToSpend $ - -- Something that is guaranteed not to be done in 'timeToSpend' - print $ ack 4 2 - end <- getMonotonicTimeNSec - let timeSpentNano = fromIntegral $ end - start -- in nanoseconds - let nanosecondsPerMicrosecond = 1000 - let timeToSpendNano = timeToSpend * nanosecondsPerMicrosecond - let legRoom = 1 * 1000 * nanosecondsPerMicrosecond -- Nanoseconds - let delta = timeSpentNano - timeToSpendNano - -- We can never wait for a shorter amount of time than specified - putStrLn $ "delta > 0: " ++ show (delta > 0) - putStrLn $ "delta < legroom: " ++ show (delta < legRoom) diff --git a/libraries/base/tests/timeout-accurate-pure.stdout b/libraries/base/tests/timeout-accurate-pure.stdout deleted file mode 100644 index 90f4a4c7e8..0000000000 --- a/libraries/base/tests/timeout-accurate-pure.stdout +++ /dev/null @@ -1,2 +0,0 @@ -delta > 0: True -delta < legroom: True |