Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
quasar
Commits
509c8d41
Commit
509c8d41
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Add more resource manager tests (failing)
parent
be85193c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Quasar/PreludeExtras.hs
+0
-2
0 additions, 2 deletions
src/Quasar/PreludeExtras.hs
test/Quasar/ResourceManagerSpec.hs
+13
-0
13 additions, 0 deletions
test/Quasar/ResourceManagerSpec.hs
with
13 additions
and
2 deletions
src/Quasar/PreludeExtras.hs
+
0
−
2
View file @
509c8d41
...
@@ -16,9 +16,7 @@ import Data.HashSet qualified as HS
...
@@ -16,9 +16,7 @@ import Data.HashSet qualified as HS
import
Data.Hashable
qualified
as
Hashable
import
Data.Hashable
qualified
as
Hashable
import
Data.List
qualified
as
List
import
Data.List
qualified
as
List
import
Data.Maybe
qualified
as
Maybe
import
Data.Maybe
qualified
as
Maybe
import
GHC.Records.Compat
(
HasField
,
getField
,
setField
)
import
GHC.Stack.Types
qualified
import
GHC.Stack.Types
qualified
import
GHC.TypeLits
(
Symbol
)
import
Quasar.Utils.ExtraT
import
Quasar.Utils.ExtraT
io
::
IO
a
->
IO
a
io
::
IO
a
->
IO
a
...
...
This diff is collapsed.
Click to expand it.
test/Quasar/ResourceManagerSpec.hs
+
13
−
0
View file @
509c8d41
...
@@ -65,7 +65,20 @@ spec = parallel $ do
...
@@ -65,7 +65,20 @@ spec = parallel $ do
liftIO
$
throwIO
TestException
liftIO
$
throwIO
TestException
\
TestException
->
True
\
TestException
->
True
it
"handles an exception while disposing"
$
io
do
(`
shouldThrow
`
\
(
_
::
CombinedException
)
->
True
)
do
withRootResourceManager
do
registerDisposeAction
$
throwIO
TestException
liftIO
$
threadDelay
100000
it
"passes an exception to the root resource manager"
$
io
do
it
"passes an exception to the root resource manager"
$
io
do
(`
shouldThrow
`
\
(
_
::
CombinedException
)
->
True
)
do
withRootResourceManager
do
withSubResourceManagerM
do
registerDisposeAction
$
throwIO
TestException
liftIO
$
threadDelay
100000
it
"passes an exception to the root resource manager when closing the inner resource manager first"
$
io
do
(`
shouldThrow
`
\
(
_
::
CombinedException
)
->
True
)
do
(`
shouldThrow
`
\
(
_
::
CombinedException
)
->
True
)
do
withRootResourceManager
do
withRootResourceManager
do
withSubResourceManagerM
do
withSubResourceManagerM
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment