Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
whqwjb
go-ethereum
提交
2e1ecc02
G
go-ethereum
项目概览
whqwjb
/
go-ethereum
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
go-ethereum
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
2e1ecc02
编写于
2月 20, 2020
作者:
G
gary rong
提交者:
GitHub
2月 20, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
les, miner, accounts/abi/bind: fix load-sensitive unit tests (#20698)
上级
6df973df
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
7 deletion
+13
-7
accounts/abi/bind/bind_test.go
accounts/abi/bind/bind_test.go
+2
-2
les/clientpool_test.go
les/clientpool_test.go
+2
-2
miner/worker_test.go
miner/worker_test.go
+9
-3
未找到文件。
accounts/abi/bind/bind_test.go
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录