[commit: ghc] master: testsuite: force plugin tests sequentially on Windows. (b290f15)

git at git.haskell.org git at git.haskell.org
Wed Jul 18 20:26:45 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b290f15c4d01d45c41c02ae5c5333a1fab022a32/ghc

>---------------------------------------------------------------

commit b290f15c4d01d45c41c02ae5c5333a1fab022a32
Author: Tamar Christina <tamar at zhox.com>
Date:   Wed Jul 18 21:05:41 2018 +0100

    testsuite: force plugin tests sequentially on Windows.
    
    Summary:
    Package registration does not seem to be thread-safe on
    Windows.  Placing the system under heavily load seems to
    trigger registration failures even though they are all
    different package-dbs.   This makes the plugin tests
    a bit flaky.
    
    I think this is because on Windows we use pessimistic locks
    while on Linux we use atomic file replacement.
    
    On Windows ReplaceFile is atomic, just the metadata write
    may not be.  Since the metadata is not of importance
    we should either switch over to ReplaceFile or
    fix the locking code to not error out but wait.
    
    For now however I have to force these 25 tests to run
    serially in order to guarantee their correctness.
    
    Test Plan: ./validate
    
    Reviewers: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #15313, #13194
    
    Differential Revision: https://phabricator.haskell.org/D4918


>---------------------------------------------------------------

b290f15c4d01d45c41c02ae5c5333a1fab022a32
 testsuite/tests/plugins/all.T | 35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T
index 34b1162..ba4b87d 100644
--- a/testsuite/tests/plugins/all.T
+++ b/testsuite/tests/plugins/all.T
@@ -1,96 +1,118 @@
 setTestOpts(req_interp)
 
+# The implementation of ghc-pkg doesn't seem to be multi-concurrent process safe
+# on windows. These tests which mutate the package db need to be run
+# sequentially until this is fixed.  This likely means that #13194 isn't fully
+# solved.  See also #15313.
+
 test('plugins01',
-     [extra_files(['simple-plugin/']),
+     [extra_files(['simple-plugin/']), when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory plugins01'])
 
 test('plugins02',
-     [extra_files(['simple-plugin/']),
+     [extra_files(['simple-plugin/']), when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins02 TOP={top}')],
      compile_fail,
      ['-package-db simple-plugin/pkg.plugins02/local.package.conf -fplugin Simple.BadlyTypedPlugin -package simple-plugin ' + config.plugin_way_flags])
 
 test('plugins03',
-     [extra_files(['simple-plugin/']),
+     [extra_files(['simple-plugin/']), when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins03 TOP={top}')],
      compile_fail,
      ['-package-db simple-plugin/pkg.plugins03/local.package.conf -fplugin Simple.NonExistentPlugin -package simple-plugin'])
 
-test('plugins04', [extra_files(['HomePackagePlugin.hs'])], multimod_compile_fail,
+test('plugins04', [extra_files(['HomePackagePlugin.hs']),
+                   when(opsys('mingw32'), multi_cpu_race)],
+     multimod_compile_fail,
      ['plugins04', '-package ghc -fplugin HomePackagePlugin'])
 
 test('plugins05', [extra_files(['HomePackagePlugin.hs']),
+                   when(opsys('mingw32'), multi_cpu_race),
                    only_ways([config.ghc_plugin_way])],
      multimod_compile_and_run, ['plugins05', '-package ghc'])
 
 test('plugins06',
      [extra_files(['LinkerTicklingPlugin.hs']),
+      when(opsys('mingw32'), multi_cpu_race),
       unless(have_dynamic(), skip), only_ways([config.ghc_plugin_way])],
      multimod_compile_and_run, ['plugins06', '-package ghc'])
 
 test('plugins07',
      [extra_files(['rule-defining-plugin/']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.plugins07 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory plugins07'])
 
 test('plugins08',
      [extra_files(['simple-plugin/']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins08 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory plugins08'])
 
 test('plugins09',
      [extra_files(['simple-plugin/']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins09 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory plugins09'])
 
 test('plugins10',
      [expect_broken(15216),
       extra_files(['simple-plugin/', 'QuasiQuotation.hs']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins10 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory plugins10'])
 
 test('plugins11',
      [extra_files(['simple-plugin/']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins11 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory plugins11'])
 
 test('plugins12',
      [extra_files(['simple-plugin/']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins12 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory plugins12'])
 
 test('plugins13',
      [extra_files(['simple-plugin/', 'PluginFilteredExport.hs']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins13 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory plugins13'])
 
 test('plugins14',
      [extra_files(['simple-plugin/']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins14 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory plugins14'])
 
 test('plugins15',
      [extra_files(['simple-plugin/', 'MetaRemoveHelper.hs']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins15 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory plugins15'])
 
 test('T10420',
      [extra_files(['rule-defining-plugin/']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C rule-defining-plugin package.T10420 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory T10420'])
 
 test('T10294',
      [extra_files(['annotation-plugin/']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294 TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory T10294'])
 
 test('T10294a',
      [extra_files(['annotation-plugin/']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294a TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory T10294a'])
 
 test('frontend01', [extra_files(['FrontendPlugin.hs']),
+                    when(opsys('mingw32'), multi_cpu_race),
                     unless(have_dynamic(), expect_broken(10301))], run_command,
      ['$MAKE -s --no-print-directory frontend01'])
 
@@ -101,11 +123,13 @@ test('T11244',
 
 test('T12567a',
      [extra_files(['T12567b.hs', 'simple-plugin/']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T12567a TOP={top}')],
      run_command, ['$MAKE -s --no-print-directory T12567a'])
 
 test('T14335',
      [extra_files(['simple-plugin/', 'plugins01.hs']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01 TOP={top}')],
      compile_fail,
      ['-package-db simple-plugin/pkg.plugins01/local.package.conf -fplugin Simple.Plugin \
@@ -113,18 +137,21 @@ test('T14335',
 
 test('plugin-recomp-pure',
      [extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
       ],
      run_command, ['$MAKE -s --no-print-directory plugin-recomp-pure'])
 
 test('plugin-recomp-impure',
      [extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
       ],
      run_command, ['$MAKE -s --no-print-directory plugin-recomp-impure'])
 
 test('plugin-recomp-flags',
      [extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
+      when(opsys('mingw32'), multi_cpu_race),
       pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
       ],
      run_command, ['$MAKE -s --no-print-directory plugin-recomp-flags'])



More information about the ghc-commits mailing list