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
2aedac82
Unverified
Commit
2aedac82
authored
Dec 23, 2023
by
Axel Kingsley
Committed by
GitHub
Dec 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Flake in TestDiscovery (#8765)
parent
bf7f81a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
host_test.go
op-node/p2p/host_test.go
+17
-14
No files found.
op-node/p2p/host_test.go
View file @
2aedac82
...
@@ -335,22 +335,25 @@ func TestDiscovery(t *testing.T) {
...
@@ -335,22 +335,25 @@ func TestDiscovery(t *testing.T) {
}
}
}
}
// For each node, check that they have recorded metadata about the other nodes during discovery
// Check that among known connections (B-A, B-C), we have metadata
for
_
,
n1
:=
range
[]
*
NodeP2P
{
nodeA
,
nodeB
,
nodeC
}
{
type
mdcheck
struct
{
eps
,
ok
:=
n1
.
Host
()
.
Peerstore
()
.
(
store
.
ExtendedPeerstore
)
n1
*
NodeP2P
require
.
True
(
t
,
ok
)
n2
*
NodeP2P
for
_
,
n2
:=
range
[]
*
NodeP2P
{
nodeA
,
nodeB
,
nodeC
}
{
}
if
n1
==
n2
{
cases
:=
[]
mdcheck
{
continue
{
nodeB
,
nodeA
},
{
nodeB
,
nodeC
},
}
}
md
,
err
:=
eps
.
GetPeerMetadata
(
n2
.
Host
()
.
ID
())
for
_
,
c
:=
range
cases
{
// make peerstore metadata available
eps
,
ok
:=
c
.
n1
.
Host
()
.
Peerstore
()
.
(
store
.
ExtendedPeerstore
)
require
.
True
(
t
,
ok
)
// confirm n1 has metadata about n2
md
,
err
:=
eps
.
GetPeerMetadata
(
c
.
n2
.
Host
()
.
ID
())
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
// we don't scrutinize the ENR itself, just that it exists
require
.
NotEmpty
(
t
,
md
.
ENR
)
require
.
NotEmpty
(
t
,
md
.
ENR
)
require
.
Equal
(
t
,
uint64
(
901
),
md
.
OPStackID
)
require
.
Equal
(
t
,
uint64
(
901
),
md
.
OPStackID
)
}
}
}
}
}
// Most tests should use mocknets instead of using the actual local host network
// Most tests should use mocknets instead of using the actual local host network
...
...
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