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
befecc9f
Unverified
Commit
befecc9f
authored
May 25, 2020
by
meowsbits
Committed by
GitHub
May 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
consensus/ethash: fix flaky test by reading seal results (#21085)
parent
e868adde
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
sealer_test.go
consensus/ethash/sealer_test.go
+7
-1
No files found.
consensus/ethash/sealer_test.go
View file @
befecc9f
...
...
@@ -97,16 +97,22 @@ func TestRemoteMultiNotify(t *testing.T) {
ethash
.
config
.
Log
=
testlog
.
Logger
(
t
,
log
.
LvlWarn
)
defer
ethash
.
Close
()
// Provide a results reader.
// Otherwise the unread results will be logged asynchronously
// and this can happen after the test is finished, causing a panic.
results
:=
make
(
chan
*
types
.
Block
,
cap
(
sink
))
// Stream a lot of work task and ensure all the notifications bubble out.
for
i
:=
0
;
i
<
cap
(
sink
);
i
++
{
header
:=
&
types
.
Header
{
Number
:
big
.
NewInt
(
int64
(
i
)),
Difficulty
:
big
.
NewInt
(
100
)}
block
:=
types
.
NewBlockWithHeader
(
header
)
ethash
.
Seal
(
nil
,
block
,
nil
,
nil
)
ethash
.
Seal
(
nil
,
block
,
results
,
nil
)
}
for
i
:=
0
;
i
<
cap
(
sink
);
i
++
{
select
{
case
<-
sink
:
<-
results
case
<-
time
.
After
(
10
*
time
.
Second
)
:
t
.
Fatalf
(
"notification %d timed out"
,
i
)
}
...
...
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