Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
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
FSL
fslpy
Commits
e5fdadb1
Commit
e5fdadb1
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
mutex unit test was broken
parent
b86f22b2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_async.py
+12
-21
12 additions, 21 deletions
tests/test_async.py
with
12 additions
and
21 deletions
tests/test_async.py
+
12
−
21
View file @
e5fdadb1
...
...
@@ -453,43 +453,34 @@ def test_mutex():
class
Thing
(
object
):
@async.mutex
def
method1
(
self
):
self
.
method1start
=
time
.
time
()
time
.
sleep
(
0.5
)
self
.
method1end
=
time
.
time
()
@async.mutex
def
method2
(
self
):
self
.
method2start
=
time
.
time
()
time
.
sleep
(
0.5
)
self
.
method2end
=
time
.
time
()
t
=
[
Thing
()]
times
=
{
'
thread1start
'
:
0
,
'
thread1end
'
:
0
,
'
thread2start
'
:
0
,
'
thread2end
'
:
0
,
}
def
thread1
():
times
[
'
thread1start
'
]
=
time
.
time
()
t
[
0
].
method1
()
times
[
'
thread1end
'
]
=
time
.
time
()
def
thread2
():
times
[
'
thread2start
'
]
=
time
.
time
()
t
[
0
].
method2
()
times
[
'
thread2start
'
]
=
time
.
time
()
for
i
in
range
(
10
):
times
=
{
'
thread1start
'
:
0
,
'
thread1end
'
:
0
,
'
thread2start
'
:
0
,
'
thread2end
'
:
0
,
}
for
i
in
range
(
20
):
t
[
0
].
method1start
=
None
t
[
0
].
method2start
=
None
t
[
0
].
method1end
=
None
t
[
0
].
method2end
=
None
t1
=
threading
.
Thread
(
target
=
thread1
)
t2
=
threading
.
Thread
(
target
=
thread2
)
...
...
@@ -498,4 +489,4 @@ def test_mutex():
t1
.
join
()
t2
.
join
()
assert
t
imes
[
'
threa
d2start
'
]
>
t
imes
[
'
threa
d1end
'
]
assert
t
[
0
].
metho
d2start
>
t
[
0
].
metho
d1end
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