Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
3952e601
Unverified
Commit
3952e601
authored
Nov 07, 2024
by
Matthew Slipper
Committed by
GitHub
Nov 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: Fix hanging network notify test (#12868)
parent
b1efd7c5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
sync_test.go
op-node/p2p/sync_test.go
+14
-8
No files found.
op-node/p2p/sync_test.go
View file @
3952e601
...
...
@@ -360,18 +360,24 @@ func TestNetworkNotifyAddPeerAndRemovePeer(t *testing.T) {
return
nil
},
metrics
.
NoopMetrics
,
&
NoopApplicationScorer
{})
waitChan
:=
make
(
chan
struct
{},
1
)
waitChan
:=
make
(
chan
struct
{},
2
)
var
connectedOnce
sync
.
Once
var
disconnectedOnce
sync
.
Once
hostA
.
Network
()
.
Notify
(
&
network
.
NotifyBundle
{
ConnectedF
:
func
(
nw
network
.
Network
,
conn
network
.
Conn
)
{
connectedOnce
.
Do
(
func
()
{
syncCl
.
AddPeer
(
conn
.
RemotePeer
())
waitChan
<-
struct
{}{}
})
},
DisconnectedF
:
func
(
nw
network
.
Network
,
conn
network
.
Conn
)
{
disconnectedOnce
.
Do
(
func
()
{
// only when no connection is available, we can remove the peer
if
nw
.
Connectedness
(
conn
.
RemotePeer
())
==
network
.
NotConnected
{
syncCl
.
RemovePeer
(
conn
.
RemotePeer
())
}
waitChan
<-
struct
{}{}
})
},
})
syncCl
.
Start
()
...
...
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