Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
a922259e
Commit
a922259e
authored
Sep 15, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b2fe5727
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
go/xcommon/xtesting/xtesting.go
go/xcommon/xtesting/xtesting.go
+10
-4
No files found.
go/xcommon/xtesting/xtesting.go
View file @
a922259e
...
...
@@ -45,10 +45,15 @@ type SyncTracer struct {
// SyncTraceMsg represents message with 1 synchronous tracing communication.
//
// the goroutine which produced the message will wait for
send on
Ack before continue.
// the goroutine which produced the message will wait for Ack before continue.
type
SyncTraceMsg
struct
{
Event
interface
{}
Ack
chan
<-
struct
{}
ack
chan
<-
struct
{}
}
// Ack acknowledges the event was processed and unpauses producer goroutine.
func
(
m
*
SyncTraceMsg
)
Ack
()
{
close
(
m
.
ack
)
}
// XXX doc
...
...
@@ -74,6 +79,7 @@ func (st *SyncTracer) Get1() *SyncTraceMsg {
}
// ----------------------------------------
// XXX naming -> SyncTraceChecker
...
...
@@ -124,7 +130,7 @@ func (tc *TraceChecker) expect1(eventExpect interface{}) {
pretty
.
Compare
(
reventExpect
.
Interface
(),
revent
.
Interface
()))
}
close
(
msg
.
Ack
)
msg
.
Ack
(
)
}
// Expect asks checker to expect next series of events to be from eventExpectV in specified order
...
...
@@ -152,7 +158,7 @@ loop:
// found matching event - good
eventExpectV
=
append
(
eventExpectV
[
:
i
],
eventExpectV
[
i
+
1
:
]
...
)
close
(
msg
.
Ack
)
// XXX -> send ack for all only when all collected?
msg
.
Ack
(
)
// XXX -> send ack for all only when all collected?
continue
loop
}
...
...
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