good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jrpc
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
open
jrpc
Commits
bed9bbf7
Commit
bed9bbf7
authored
1 year ago
by
Garet Halliday
Browse files
Options
Downloads
Patches
Plain Diff
ah
parent
e7132c8e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!35
fix tests
Pipeline
#33253
passed with stage
in 7 minutes and 34 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/extension/subscription/client.go
+4
-0
4 additions, 0 deletions
contrib/extension/subscription/client.go
contrib/extension/subscription/client_test.go
+15
-8
15 additions, 8 deletions
contrib/extension/subscription/client_test.go
with
19 additions
and
8 deletions
contrib/extension/subscription/client.go
+
4
−
0
View file @
bed9bbf7
...
...
@@ -76,6 +76,10 @@ func (c *WrapClient) Subscribe(ctx context.Context, namespace string, channel an
return
nil
,
ErrSubscriptionNotFound
}
// FIXME(garet): we can lose subscription messages here. if they send a notification and the server handles it
// before we finish adding it to the subs, the message will be lost. Ping will almost always be much much longer
// than us adding the sub so it probably doesn't matter. but it fails the unit tests :(
// now create a client sub
sub
:=
&
clientSub
{
engine
:
c
,
...
...
This diff is collapsed.
Click to expand it.
contrib/extension/subscription/client_test.go
+
15
−
8
View file @
bed9bbf7
...
...
@@ -28,11 +28,14 @@ func TestSubscription(t *testing.T) {
return
}
for
i
:=
0
;
i
<
count
;
i
++
{
if
err
:=
notifier
.
Notify
(
i
);
err
!=
nil
{
panic
(
err
)
go
func
()
{
time
.
Sleep
(
10
*
time
.
Millisecond
)
for
i
:=
0
;
i
<
count
;
i
++
{
if
err
:=
notifier
.
Notify
(
i
);
err
!=
nil
{
panic
(
err
)
}
}
}
}
()
})
srv
:=
server
.
NewServer
(
r
)
...
...
@@ -80,11 +83,14 @@ func TestUnsubscribeNoRead(t *testing.T) {
return
}
for
i
:=
0
;
i
<
10
;
i
++
{
if
err
:=
notifier
.
Notify
(
i
);
err
!=
nil
{
panic
(
err
)
go
func
()
{
time
.
Sleep
(
10
*
time
.
Millisecond
)
for
i
:=
0
;
i
<
10
;
i
++
{
if
err
:=
notifier
.
Notify
(
i
);
err
!=
nil
{
panic
(
err
)
}
}
}
}
()
})
srv
:=
server
.
NewServer
(
r
)
...
...
@@ -136,6 +142,7 @@ func TestWrapClient(t *testing.T) {
return
}
go
func
()
{
time
.
Sleep
(
10
*
time
.
Millisecond
)
idx
:=
0
for
{
select
{
...
...
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