Skip to content

Commit

Permalink
Remove unneeded test
Browse files Browse the repository at this point in the history
Sqlite does write locking by default so this test is redundant.
  • Loading branch information
v0d1ch committed Nov 24, 2024
1 parent df2a592 commit 5e94ecd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion hydra-node/hydra-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ test-suite tests
, regex-tdfa
, req
, silently
, sqlite-simple
, temporary
, text
, time
Expand Down
16 changes: 0 additions & 16 deletions hydra-node/test/Hydra/SqlLitePersistenceSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Test.Hydra.Prelude
import Data.Aeson (Value (..))
import Data.Aeson qualified as Aeson
import Data.Text qualified as Text
import Database.SQLite.Simple (SQLError (..))
import Hydra.SqlLitePersistence (Persistence (..), PersistenceIncremental (..), createPersistence, createPersistenceIncremental)
import Test.QuickCheck (checkCoverage, cover, elements, oneof, suchThat, (===))
import Test.QuickCheck.Gen (listOf)
Expand Down Expand Up @@ -55,21 +54,6 @@ spec = do
loadAll
pure $ actualResult === items

it "it cannot load from a different thread once having started appending" $
monadicIO $ do
items <- pick $ listOf genPersistenceItem
moreItems <- pick $ listOf genPersistenceItem `suchThat` ((> 2) . length)
pure $
withTempDir "hydra-persistence" $ \tmpDir -> do
PersistenceIncremental{loadAll, append} <- createPersistenceIncremental $ tmpDir <> "/data"
forM_ items append
loadAll `shouldReturn` items
race_
(forever $ threadDelay 0.01 >> loadAll)
(forM_ moreItems $ \item -> append item >> threadDelay 0.01)
`shouldThrow` \case
SQLError{} -> True

genPersistenceItem :: Gen Aeson.Value
genPersistenceItem =
oneof
Expand Down

0 comments on commit 5e94ecd

Please sign in to comment.