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
2e1ecc02
Unverified
Commit
2e1ecc02
authored
Feb 20, 2020
by
gary rong
Committed by
GitHub
Feb 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
les, miner, accounts/abi/bind: fix load-sensitive unit tests (#20698)
parent
6df973df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
bind_test.go
accounts/abi/bind/bind_test.go
+2
-2
clientpool_test.go
les/clientpool_test.go
+2
-2
worker_test.go
miner/worker_test.go
+9
-3
No files found.
accounts/abi/bind/bind_test.go
View file @
2e1ecc02
...
...
@@ -1384,7 +1384,7 @@ var bindTests = []struct {
if n != 3 {
t.Fatalf("Invalid bar0 event")
}
case <-time.NewTimer(
100 * time.Millis
econd).C:
case <-time.NewTimer(
3 * time.S
econd).C:
t.Fatalf("Wait bar0 event timeout")
}
...
...
@@ -1395,7 +1395,7 @@ var bindTests = []struct {
if n != 1 {
t.Fatalf("Invalid bar event")
}
case <-time.NewTimer(
100 * time.Millis
econd).C:
case <-time.NewTimer(
3 * time.S
econd).C:
t.Fatalf("Wait bar event timeout")
}
close(stopCh)
...
...
les/clientpool_test.go
View file @
2e1ecc02
...
...
@@ -517,7 +517,7 @@ func TestNodeDBExpiration(t *testing.T) {
for
_
,
c
:=
range
cases
{
ndb
.
setNB
(
c
.
ip
,
c
.
balance
)
}
time
.
Sleep
(
100
*
time
.
Millisecond
)
// Ensure the db expirer is registered.
clock
.
WaitForTimers
(
1
)
clock
.
Run
(
time
.
Hour
+
time
.
Minute
)
select
{
case
<-
done
:
...
...
@@ -527,7 +527,7 @@ func TestNodeDBExpiration(t *testing.T) {
if
iterated
!=
4
{
t
.
Fatalf
(
"Failed to evict useless negative balances, want %v, got %d"
,
4
,
iterated
)
}
clock
.
WaitForTimers
(
1
)
for
_
,
c
:=
range
cases
{
ndb
.
setNB
(
c
.
ip
,
c
.
balance
)
}
...
...
miner/worker_test.go
View file @
2e1ecc02
...
...
@@ -215,12 +215,16 @@ func testGenerateBlockAndImport(t *testing.T, isClique bool) {
chain
,
_
:=
core
.
NewBlockChain
(
db2
,
nil
,
b
.
chain
.
Config
(),
engine
,
vm
.
Config
{},
nil
)
defer
chain
.
Stop
()
loopErr
:=
make
(
chan
error
)
newBlock
:=
make
(
chan
struct
{})
var
(
loopErr
=
make
(
chan
error
)
newBlock
=
make
(
chan
struct
{})
subscribe
=
make
(
chan
struct
{})
)
listenNewBlock
:=
func
()
{
sub
:=
w
.
mux
.
Subscribe
(
core
.
NewMinedBlockEvent
{})
defer
sub
.
Unsubscribe
()
subscribe
<-
struct
{}{}
for
item
:=
range
sub
.
Chan
()
{
block
:=
item
.
Data
.
(
core
.
NewMinedBlockEvent
)
.
Block
_
,
err
:=
chain
.
InsertChain
([]
*
types
.
Block
{
block
})
...
...
@@ -234,9 +238,11 @@ func testGenerateBlockAndImport(t *testing.T, isClique bool) {
w
.
skipSealHook
=
func
(
task
*
task
)
bool
{
return
len
(
task
.
receipts
)
==
0
}
w
.
start
()
// Start mining!
go
listenNewBlock
()
<-
subscribe
// Ensure the subscription is created
w
.
start
()
// Start mining!
for
i
:=
0
;
i
<
5
;
i
++
{
b
.
txPool
.
AddLocal
(
b
.
newRandomTx
(
true
))
b
.
txPool
.
AddLocal
(
b
.
newRandomTx
(
false
))
...
...
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