Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
78328906
Commit
78328906
authored
Jun 13, 2016
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/downloader: fix occasional fast sync critical section test fails
parent
ce88d419
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
downloader_test.go
eth/downloader/downloader_test.go
+3
-1
No files found.
eth/downloader/downloader_test.go
View file @
78328906
...
@@ -1824,13 +1824,15 @@ func testFastCriticalRestarts(t *testing.T, protocol int) {
...
@@ -1824,13 +1824,15 @@ func testFastCriticalRestarts(t *testing.T, protocol int) {
for
i
:=
0
;
i
<
fsPivotInterval
;
i
++
{
for
i
:=
0
;
i
<
fsPivotInterval
;
i
++
{
tester
.
peerMissingStates
[
"peer"
][
headers
[
hashes
[
fsMinFullBlocks
+
i
]]
.
Root
]
=
true
tester
.
peerMissingStates
[
"peer"
][
headers
[
hashes
[
fsMinFullBlocks
+
i
]]
.
Root
]
=
true
}
}
tester
.
downloader
.
dropPeer
=
func
(
id
string
)
{}
// We reuse the same "faulty" peer throughout the test
// Synchronise with the peer a few times and make sure they fail until the retry limit
// Synchronise with the peer a few times and make sure they fail until the retry limit
for
i
:=
0
;
i
<
fsCriticalTrials
;
i
++
{
for
i
:=
0
;
i
<
fsCriticalTrials
;
i
++
{
// Attempt a sync and ensure it fails properly
// Attempt a sync and ensure it fails properly
if
err
:=
tester
.
sync
(
"peer"
,
nil
,
FastSync
);
err
==
nil
{
if
err
:=
tester
.
sync
(
"peer"
,
nil
,
FastSync
);
err
==
nil
{
t
.
Fatalf
(
"failing fast sync succeeded: %v"
,
err
)
t
.
Fatalf
(
"failing fast sync succeeded: %v"
,
err
)
}
}
time
.
Sleep
(
5
00
*
time
.
Millisecond
)
// Make sure no in-flight requests remain
time
.
Sleep
(
1
00
*
time
.
Millisecond
)
// Make sure no in-flight requests remain
// If it's the first failure, pivot should be locked => reenable all others to detect pivot changes
// If it's the first failure, pivot should be locked => reenable all others to detect pivot changes
if
i
==
0
{
if
i
==
0
{
...
...
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