@@ -2,7 +2,9 @@
2{-# LANGUAGE CPP #-}
2{-# LANGUAGE CPP #-}
3{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE OverloadedStrings #-}
4{-# LANGUAGE RecursiveDo #-}
4{-# LANGUAGE RecursiveDo #-}
5+{-# LANGUAGE ScopedTypeVariables #-}
5import Control.Concurrent
6import Control.Concurrent
7+import Control.Exception
6import Control.Monad
8import Control.Monad
7import Control.Monad.IO.Class
9import Control.Monad.IO.Class
8import Data.Int
10import Data.Int
@@ -36,11 +38,13 @@ failureLimit = 0
36main :: IO ()
38main :: IO ()
38 uid <- getEffectiveUserID
40 uid <- getEffectiveUserID
41+ handle (\(_ :: IOError) -> return ()) $ do -- If we run into an exception with sandboxing, just don't bother
39− unshare [User, Network]
42+ unshare [User, Network]
40− writeUserMappings Nothing [UserMapping 0 uid 1]
43+ writeUserMappings Nothing [UserMapping 0 uid 1]
44+ callCommand "ip link set lo up ; ip addr"
41 mainThread <- myThreadId
45 mainThread <- myThreadId
42 withSystemTempDirectory "reflex-dom-core_test_gc" $ \tmp -> do
46 withSystemTempDirectory "reflex-dom-core_test_gc" $ \tmp -> do
43− browserProcess <- spawnCommand $ "ip link set lo up ; ip addr ; sleep 1 ; echo 'Starting Chromium' ; chromium --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 --user-data-dir=" ++ tmp ++ " http://localhost:3911 ; echo 'Chromium exited'"
47+ browserProcess <- spawnCommand $ "echo 'Starting Chromium' ; chromium --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 --user-data-dir=" ++ tmp ++ " http://localhost:3911 ; echo 'Chromium exited'"
44 let finishTest result = do
48 let finishTest result = do
45 interruptProcessGroupOf browserProcess
49 interruptProcessGroupOf browserProcess
46 throwTo mainThread result
50 throwTo mainThread result