Skip to content

ghcide test failures in Gentoo Linux #3221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks
hololeap opened this issue Sep 24, 2022 · 9 comments
Open
3 tasks

ghcide test failures in Gentoo Linux #3221

hololeap opened this issue Sep 24, 2022 · 9 comments
Labels
status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@hololeap
Copy link
Contributor

hololeap commented Sep 24, 2022

I'm getting a few test failures for ghcide-1.8.0.0 when they are run with Gentoo's network-sandbox disabled (so unrelated to #3126):

  • incomplete entries

    FAIL (31.99s)
         test/exe/Main.hs:1653:
         expected: ["AAAAA"]
          but got: ["AAAAA","AAAA","AAAA"]
         Use -p '/incomplete entries/' to rerun this test only.
    
  • Map

    FAIL (33.01s)
         test/exe/Main.hs:1807:
         expected: ["Defined in 'Data.Map","Defined in 'Data.Map.Lazy","Defined in 'Data.Map.Strict"]
          but got: []
         Use -p '/Map/' to rerun this test only.
    
  • Module is symlinked

    FAIL
       Exception: /var/tmp/portage/dev-haskell/ghcide-1.8.0.0/temp/extra-dir-12909185275211/other_loc/Sym.hs: createFileLink:createSymbolicLink: does not exist (No such file or directory)
       Use -p '/Module is symlinked/' to rerun this test only.
    
3 out of 344 tests failed (2492.75s)

Full build log is here (raw file is ~15MB)


Your environment

GHC 9.0.2 on Gentoo Linux. All packages are installed through the system package manager.

ghcide-1.8.0.0 is being built with the ghc-patched-unboxed-bytecode flag turned OFF. (I hit other test failures when it was turned on.)


Other gentoo-haskell-related test issues:

@hololeap hololeap added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Sep 24, 2022
@pepeiborra
Copy link
Collaborator

The problem is that Tasty runs test in parallel by default, and most HLS test suites do not handle this well. Set TASTY_NUM_THREADS to 1

@michaelpj
Copy link
Collaborator

The problem is that Tasty runs test in parallel by default, and most HLS test suites do not handle this well.

Isn't the number of threads a tasty option? Could we set it explicitly in the test suites to 1 using adjustOption?

@pepeiborra
Copy link
Collaborator

The problem is that Tasty runs test in parallel by default, and most HLS test suites do not handle this well.

Isn't the number of threads a tasty option? Could we set it explicitly in the test suites to 1 using adjustOption?

That would be great

@michaelpj
Copy link
Collaborator

I made an issue for this: #3245

@michaelpj
Copy link
Collaborator

Did Pepe's suggestion help?

@michaelpj michaelpj added status: needs info Not actionable, because there's missing information and removed status: needs info Not actionable, because there's missing information status: needs triage labels Oct 5, 2022
@hololeap
Copy link
Contributor Author

hololeap commented Oct 6, 2022

It seems that the Map test fails consistently even with @pepeiborra's suggestion and also using cabal-v1/cabal-v2 and network-sandbox/no-network-sandbox. The others are not as consistent.

I want to try to get a build environment set up that mirrors the CI exactly, hopefully get all the tests passing, then work backwards and see what is different in Gentoo compared to the CI environment (package versions, etc.)

@hololeap
Copy link
Contributor Author

hololeap commented Oct 28, 2022

I cannot get the Map test to pass with cabal-v1 no matter what I try! Here are the steps I took to verify I could get all tests passing with cabal-v2 and then set up the same environment for cabal-v1:

  1. I installed ghc-9.0.2 through Gentoo's package manager.

  2. I checked out e36208b, as this was the latest commit at the time and all CI tests were passing.

  3. cabal v2-configure --enable-tests --disable-benchmarks -O0 --flag=-ekg
    cabal v2-build all
    export TASTY_NUM_THREADS=1
    cabal v2-test ghcide --test-show-details=streaming --test-option=--color=always --test-option=--ansi-tricks=false

    All tests pass! 🎉

  4. I created cabal.project.freeze and made sure all packages installed through Gentoo were consistent with the versions in the file (the only exception was hsc2hs which was version 0.68.8 in the freeze file and 0.68.7 on the system.)

  5. cd ghcide
    cabal v1-configure --enable-tests --disable-benchmarks -O0 --flag=-ekg
    cabal v1-build
    export PATH="$(realpath dist/build/ghcide):$(realpath dist/build/ghcide-test-preprocessor):$PATH"
    export TASTY_NUM_THREADS=1
    cabal v1-test --show-details=streaming --test-option=--color=always
          Map:                                                                            FAIL (14.60s)
            test/exe/Main.hs:1807:
            expected: ["Defined in 'Data.Map","Defined in 'Data.Map.Lazy","Defined in 'Data.Map.Strict"]
             but got: []
            Use -p '/Map/' to rerun this test only.
    
    1 out of 344 tests failed (1512.25s)
    

    😠

@hololeap
Copy link
Contributor Author

hololeap commented Oct 28, 2022

Hm, it looks like I'm getting some inconsistencies with Map using cabal-v2 as well.

  1. $ cabal v2-test ghcide --test-show-details=streaming --test-option=--color=always --test-option=--ansi-tricks=false --test-option=-p --test-option='/Map/'
    Build profile: -w ghc-9.0.2 -O0
    In order, the following will be built (use -v for more details):
    - ghcide-1.8.0.0 (exe:ghcide-test-preprocessor) (configuration changed)
    - hie-compat-0.3.0.0 (lib) (configuration changed)
    - hls-graph-1.8.0.0 (lib) (configuration changed)
    - hiedb-0.4.2.0 (lib) (dependency rebuilt)
    - hls-plugin-api-1.5.0.0 (lib) (configuration changed)
    - ghcide-1.8.0.0 (lib) (configuration changed)
    - ghcide-1.8.0.0 (exe:ghcide) (configuration changed)
    - ghcide-1.8.0.0 (test:ghcide-tests) (configuration changed)
    Configuring library for hie-compat-0.3.0.0..
    Configuring library for hls-graph-1.8.0.0..
    Configuring executable 'ghcide-test-preprocessor' for ghcide-1.8.0.0..
    Preprocessing executable 'ghcide-test-preprocessor' for ghcide-1.8.0.0..
    Building executable 'ghcide-test-preprocessor' for ghcide-1.8.0.0..
    Preprocessing library for hie-compat-0.3.0.0..
    Building library for hie-compat-0.3.0.0..
    Preprocessing library for hls-graph-1.8.0.0..
    Building library for hls-graph-1.8.0.0..
    Preprocessing library for hiedb-0.4.2.0..
    Building library for hiedb-0.4.2.0..
    Configuring library for hls-plugin-api-1.5.0.0..
    Preprocessing library for hls-plugin-api-1.5.0.0..
    Building library for hls-plugin-api-1.5.0.0..
    Configuring library for ghcide-1.8.0.0..
    Preprocessing library for ghcide-1.8.0.0..
    Building library for ghcide-1.8.0.0..
    /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: type and size of dynamic symbol `hlszmpluginzmapizm1zi5zi0zi0zminplace_IdeziTypes_zdfIsStringPluginId_closure' are not de
    fined
    /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: type and size of dynamic symbol `hlszmpluginzmapizm1zi5zi0zi0zminplace_IdeziTypes_zdfIsStringCommandId_closure' are not d
    efined
    /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: warning: type and size of dynamic symbol `hlszmpluginzmapizm1zi5zi0zi0zminplace_IdeziPluginziConfig_zdfDefaultConfig_closure' are
    not defined
    Configuring executable 'ghcide' for ghcide-1.8.0.0..
    Preprocessing executable 'ghcide' for ghcide-1.8.0.0..
    Building executable 'ghcide' for ghcide-1.8.0.0..
    Configuring test suite 'ghcide-tests' for ghcide-1.8.0.0..
    Preprocessing test suite 'ghcide-tests' for ghcide-1.8.0.0..
    Building test suite 'ghcide-tests' for ghcide-1.8.0.0..
    
    <no location info>: warning: [-Wunused-packages]
        The following packages were specified via -package or -package-id flags,
        but were not needed for compilation:
        - record-hasfield-1.0
        - record-dot-preprocessor-0.2.15
        - ghc-typelits-knownnat-0.7.6
        - ghc-9.0.2
    
    <no location info>: warning: [-Wunused-packages]
        The following packages were specified via -package or -package-id flags,
        but were not needed for compilation:
        - record-hasfield-1.0
        - record-dot-preprocessor-0.2.15
        - ghc-typelits-knownnat-0.7.6
        - ghc-9.0.2
    Running 1 test suites...
    Test suite ghcide-tests: RUNNING...
    ghcide
    completion
        package
        Map: FAIL (21.04s)
            test/exe/Main.hs:1807:
            expected: ["Defined in 'Data.Map","Defined in 'Data.Map.Lazy","Defined in 'Data.Map.Strict"]
            but got: ["Defined in 'Data.Generics.Uniplate.Data.Instances","Defined in 'Data.Map","Defined in 'Data.Map.Lazy"]
    
    1 out of 1 tests failed (21.04s)
    Test suite ghcide-tests: FAIL
    Test suite logged to:
    /home/admin/haskell-language-server-cabal/dist-newstyle/build/x86_64-linux/ghc-9.0.2/ghcide-1.8.0.0/t/ghcide-tests/noopt/test/ghcide-1.8.0.0-ghcide-tests.log
    0 of 1 test suites (0 of 1 test cases) passed.
    cabal: Tests failed for test:ghcide-tests from ghcide-1.8.0.0.
  2. $ cabal v2-test ghcide --test-show-details=streaming --test-option=--color=always --test-option=--ansi-tricks=false --test-option=-p --test-option='/Map/'
    Build profile: -w ghc-9.0.2 -O0
    In order, the following will be built (use -v for more details):
    - ghcide-1.8.0.0 (test:ghcide-tests) (first run)
    Preprocessing test suite 'ghcide-tests' for ghcide-1.8.0.0..
    Building test suite 'ghcide-tests' for ghcide-1.8.0.0..
    
    <no location info>: warning: [-Wunused-packages]
        The following packages were specified via -package or -package-id flags,
        but were not needed for compilation:
        - record-hasfield-1.0
        - record-dot-preprocessor-0.2.15
        - ghc-typelits-knownnat-0.7.6
        - ghc-9.0.2
    
    <no location info>: warning: [-Wunused-packages]
        The following packages were specified via -package or -package-id flags,
        but were not needed for compilation:
        - record-hasfield-1.0
        - record-dot-preprocessor-0.2.15
        - ghc-typelits-knownnat-0.7.6
        - ghc-9.0.2
    Running 1 test suites...
    Test suite ghcide-tests: RUNNING...
    ghcide
    completion
        package
        Map: FAIL (17.58s)
            test/exe/Main.hs:1807:
            expected: ["Defined in 'Data.Map","Defined in 'Data.Map.Lazy","Defined in 'Data.Map.Strict"]
            but got: []
    
    1 out of 1 tests failed (17.58s)
    Test suite ghcide-tests: FAIL
    Test suite logged to:
    /home/admin/haskell-language-server-cabal/dist-newstyle/build/x86_64-linux/ghc-9.0.2/ghcide-1.8.0.0/t/ghcide-tests/noopt/test/ghcide-1.8.0.0-ghcide-tests.log
    0 of 1 test suites (0 of 1 test cases) passed.
    cabal: Tests failed for test:ghcide-tests from ghcide-1.8.0.0.

@hololeap
Copy link
Contributor Author

hololeap commented Oct 28, 2022

I'm going to play around with the source vs. installed constraints and see if I can bisect down to a specific set of packages that are introducing the test failure when using installed versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

3 participants