Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
83
Issues
83
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
0d110ed4
Verified
Commit
0d110ed4
authored
Dec 21, 2020
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update MemoryLeaks test
parent
8291ce34
Pipeline
#47650
passed with stages
in 9 minutes and 10 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
25 deletions
+21
-25
Tests/MemoryLeaks.icl
Tests/MemoryLeaks.icl
+21
-25
No files found.
Tests/MemoryLeaks.icl
View file @
0d110ed4
...
...
@@ -18,44 +18,40 @@ repetitions =: 1000
tests
::
[
UnitTest
]
tests
=:
[
memoryConsumptionOf
"recursive step"
recursiveStep
,
memoryConsumptionOf
"local share"
localShare
,
memoryConsumptionOf
"parallel task"
parallelTask
,
memoryConsumptionOf
"shared interaction task"
sharedInteraction
[
memoryConsumptionOf
"recursive step"
getIWorldSize
,
memoryConsumptionOf
"local share"
(
withShared
3
\_
->
getIWorldSize
)
,
memoryConsumptionOf
"parallel task"
(
viewInformation
[]
3
||-
getIWorldSize
)
,
memoryConsumptionOf
"shared interaction task"
(
withShared
3
\
sds
->
viewSharedInformation
[]
sds
||-
getIWorldSize
)
]
recursiveStep
::
Task
[
Int
]
recursiveStep
=:
sequence
$
repeatn
repetitions
getIWorldSize
localShare
::
Task
[
Int
]
localShare
=:
sequence
$
repeatn
repetitions
(
withShared
3
\_
->
getIWorldSize
)
parallelTask
::
Task
[
Int
]
parallelTask
=:
sequence
$
repeatn
repetitions
(
viewInformation
[]
3
||-
getIWorldSize
)
sharedInteraction
::
Task
[
Int
]
sharedInteraction
=:
sequence
$
repeatn
repetitions
(
withShared
3
\
sds
->
viewSharedInformation
[]
sds
||-
getIWorldSize
)
memoryConsumptionOf
::
!
String
!(
Task
[
Int
])
->
UnitTest
memoryConsumptionOf
::
!
String
!(
Task
Int
)
->
UnitTest
memoryConsumptionOf
label
task
=
testTaskResult
(
"memory consumption of "
+++
label
)
task
events
[]
iWorldSizeIsNotIncreasing
(
"memory consumption of "
+++
label
)
(
seqTask
0
(
Left
[]))
events
(
0
,
0
)
iWorldSizeIsNotIncreasing
where
events
=
[
Left
ResetEvent
]
iWorldSizeIsNotIncreasing
::
[
Int
]
![
Int
]
->
EndEventType
iWorldSizeIsNotIncreasing
_
iWorldSizes
// Because sizes are not entirely stable, we take the maximum of the initial 10% IWorld sizes as the initial value.
// When the value is Left, we are still collecting the first 10% of values to determine the initial IWorld size.
// When the value is Right, we have the initial IWorld size and are updating only the final IWorld size.
seqTask
i
(
Left
sizes
)
=
task
>>-
\
sz
|
i
>=
repetitions
/
10
->
seqTask
(
i
+1
)
(
Right
(
maxList
[
sz
:
sizes
],
sz
))
->
seqTask
(
i
+1
)
(
Left
[
sz
:
sizes
])
seqTask
i
(
Right
result
=:(
initSize
,
endSize
))
|
i
>=
repetitions
=
return
result
=
task
>>-
\
sz
->
seqTask
(
i
+1
)
(
Right
(
initSize
,
sz
))
iWorldSizeIsNotIncreasing
::
a
!(!
Int
,!
Int
)
->
EndEventType
iWorldSizeIsNotIncreasing
_
(
initSize
,
endSize
)
|
endSize
<=
initSize
=
Passed
|
otherwise
=
Failed
$
?
Just
$
CustomFailReason
$
concat
[
"Memory consumption increased by "
,
toString
$
endSize
-
initSize
,
" bytes."
]
where
// As there is some variation in the size, we use the max of the first 10% of the sizes as initial value.
initSize
=
'
DF
'.
maximum
$
take
(
repetitions
/
10
)
iWorldSizes
endSize
=
last
iWorldSizes
getIWorldSize
::
Task
Int
getIWorldSize
=
mkInstantTask
\_
iworld
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment