[Git][ghc/ghc][wip/sjakobi/nonmoving-gc-test-fixes] 2 commits: testsuite: Omit T22859 in nonmoving threaded ways
Simon Jakobi pushed to branch wip/sjakobi/nonmoving-gc-test-fixes at Glasgow Haskell Compiler / GHC Commits: 84b93041 by Simon Jakobi at 2026-07-28T23:12:27+02:00 testsuite: Omit T22859 in nonmoving threaded ways T22859 checks allocation-limit handlers with output that depends on precise allocation behaviour. The nonmoving threaded ways change where these limits are reached, just as the already-omitted LLVM ways do. Omit these ways instead of treating their incidental output differences as test failures. Assisted-by: gpt-5.6-sol via Codex CLI - - - - - 514e985c by Simon Jakobi at 2026-07-28T23:12:27+02:00 testsuite: Make listThreads1 insensitive to the RTS's own threads listThreads1 expected `listThreads` to return exactly `[ThreadId 1]`. That holds only under a non-threaded RTS: a threaded RTS forks the per-capability `IOManager on cap N` threads and the `TimerManager` from `hs_init_ghc` before `main` runs, so the test fails in every threaded way. The test was added in d442ac053f ("JS: fix thread-related primops") as a regression test for the JS backend's ListThreadsOp, which returned the `h$threads` run queue and thereby omitted the *running* thread. Checking that `myThreadId` is among the listed threads states that property directly, and still catches the original bug. Checking for the presence of `ThreadId 1` would not do: under a threaded RTS the main thread is created last, and `ThreadId 1` is a startup thread that has already finished and disappears from the list at the next major GC. This mirrors 8519af6080 ("testsuite: Make listThreads more robust"). Assisted-by: Claude Opus 4.5 - - - - - 3 changed files: - libraries/base/tests/listThreads1.hs - libraries/base/tests/listThreads1.stdout - testsuite/tests/rts/all.T Changes: ===================================== libraries/base/tests/listThreads1.hs ===================================== @@ -2,5 +2,10 @@ module Main where import GHC.Conc.Sync +-- Regression test for the JS backend's ListThreadsOp, which used to omit the +-- running thread. Whatever other threads the RTS has is irrelevant here. main :: IO () -main = listThreads >>= print +main = do + tid <- myThreadId + ts <- listThreads + print (tid `elem` ts) ===================================== libraries/base/tests/listThreads1.stdout ===================================== @@ -1 +1 @@ -[ThreadId 1] +True ===================================== testsuite/tests/rts/all.T ===================================== @@ -679,7 +679,7 @@ test('T22859', [js_skip, # This test is vulnerable to changes in allocation behaviour, so we disable it in some ways when(arch('wasm32'), skip), - omit_ways(llvm_ways)], + omit_ways(llvm_ways + ['nonmoving_thr', 'nonmoving_thr_sanity'])], compile_and_run, ['-with-rtsopts -A8K']) # These tests need access to the internal RTS headers. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ac137b50d30c9511a7994ac59e6d951... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ac137b50d30c9511a7994ac59e6d951... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Simon Jakobi (@sjakobi)