timeoutTester :: Int -> [QueueAction Int] -> [Maybe [Int]] -> Assertion
timeoutTester timeout = testActions $
        TestableChunkedQueue
            newTMChunkedQueueIO
            (drainWithTimeoutTMChunkedQueue timeout)
            ((fmap collapseMaybe) . atomically . tryDrainTMChunkedQueue)
            writeTMChunkedQueue
            closeTMChunkedQueue

    where
        collapseMaybe Nothing = mempty
        collapseMaybe (Just xs) = xs
timeoutTester :: Int -> [QueueAction Int] -> [Maybe [Int]] -> Assertion
timeoutTester timeout = testActions $
        TestableChunkedQueue
            newTMChunkedQueueIO
            (drainWithTimeoutTMChunkedQueue timeout)
            ((fmap collapseMaybe) . atomically . tryDrainTMChunkedQueue)
            writeTMChunkedQueue
            closeTMChunkedQueue

    where
        collapseMaybe Nothing = mempty
        collapseMaybe (Just xs) = xs
timeoutTester timeout = testActions $
        TestableChunkedQueue
            newTMChunkedQueueIO
            (drainWithTimeoutTMChunkedQueue timeout)
            ((fmap collapseMaybe) . atomically . tryDrainTMChunkedQueue)
            writeTMChunkedQueue
            closeTMChunkedQueue

    where
        collapseMaybe Nothing = mempty
        collapseMaybe (Just xs) = xs