Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-blockstore
Commits
64d89ae7
Commit
64d89ae7
authored
Jan 20, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blockstore: fixed data race
parent
c637d733
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
blockstore_test.go
blockstore_test.go
+6
-0
No files found.
blockstore_test.go
View file @
64d89ae7
...
...
@@ -118,9 +118,11 @@ func TestAllKeysRespectsContext(t *testing.T) {
// Once without context, to make sure it all works
{
var
results
dsq
.
Results
var
resultsmu
=
make
(
chan
struct
{})
resultChan
:=
make
(
chan
dsq
.
Result
)
d
.
SetFunc
(
func
(
q
dsq
.
Query
)
(
dsq
.
Results
,
error
)
{
results
=
dsq
.
ResultsWithChan
(
q
,
resultChan
)
resultsmu
<-
struct
{}{}
return
results
,
nil
})
...
...
@@ -128,6 +130,7 @@ func TestAllKeysRespectsContext(t *testing.T) {
// make sure it's waiting.
<-
started
<-
resultsmu
select
{
case
<-
done
:
t
.
Fatal
(
"sync is wrong"
)
...
...
@@ -156,9 +159,11 @@ func TestAllKeysRespectsContext(t *testing.T) {
// Once with
{
var
results
dsq
.
Results
var
resultsmu
=
make
(
chan
struct
{})
resultChan
:=
make
(
chan
dsq
.
Result
)
d
.
SetFunc
(
func
(
q
dsq
.
Query
)
(
dsq
.
Results
,
error
)
{
results
=
dsq
.
ResultsWithChan
(
q
,
resultChan
)
resultsmu
<-
struct
{}{}
return
results
,
nil
})
...
...
@@ -167,6 +172,7 @@ func TestAllKeysRespectsContext(t *testing.T) {
// make sure it's waiting.
<-
started
<-
resultsmu
select
{
case
<-
done
:
t
.
Fatal
(
"sync is wrong"
)
...
...
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