summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-06-07 16:05:52 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-21 13:32:34 -0400
commitaa5164313aa86941bf15722936824dfbf556a911 (patch)
tree2dbd6e0847462c28e9166f5647f21c75362ea022
parent2485c08aeecd9664bca7812e69e59b85ce16c079 (diff)
downloadhaskell-aa5164313aa86941bf15722936824dfbf556a911.tar.gz
testsuite: Mark T3372 as fragile on Windows
On Windows we must lock package databases even when opening for read-only access. This means that concurrent GHC sessions are very likely to fail with file lock contention. See #16773.
-rw-r--r--libraries/ghc-boot/GHC/PackageDb.hs2
-rw-r--r--testsuite/tests/ghci/linking/dyn/all.T8
2 files changed, 9 insertions, 1 deletions
diff --git a/libraries/ghc-boot/GHC/PackageDb.hs b/libraries/ghc-boot/GHC/PackageDb.hs
index c7984d0edb..31073711d4 100644
--- a/libraries/ghc-boot/GHC/PackageDb.hs
+++ b/libraries/ghc-boot/GHC/PackageDb.hs
@@ -387,6 +387,8 @@ decodeFromFile :: FilePath -> DbOpenMode mode t -> Get pkgs ->
IO (pkgs, DbOpenMode mode PackageDbLock)
decodeFromFile file mode decoder = case mode of
DbOpenReadOnly -> do
+ -- Note [Locking package database on Windows]
+ -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- When we open the package db in read only mode, there is no need to acquire
-- shared lock on non-Windows platform because we update the database with an
-- atomic rename, so readers will always see the database in a consistent
diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T
index 75b1635dd0..46ba064c17 100644
--- a/testsuite/tests/ghci/linking/dyn/all.T
+++ b/testsuite/tests/ghci/linking/dyn/all.T
@@ -45,5 +45,11 @@ test('big-obj', [extra_files(['big-obj-c.c', 'big-obj.hs']),
unless(doing_ghci, skip), unless(opsys('mingw32'), skip)],
makefile_test, ['big-obj'])
-test('T3372', [unless(doing_ghci, skip), extra_run_opts('"' + config.libdir + '"')],
+test('T3372',
+ [unless(doing_ghci, skip),
+ extra_run_opts('"' + config.libdir + '"'),
+ # Concurrent GHC sessions is fragile on Windows since we must lock the
+ # package database even for read-only access.
+ # See Note [Locking package database on Windows] in GHC.PackageDb
+ when(opsys('mingw32'), fragile(16773))],
compile_and_run, ['-package ghc'])