add test for new api

This commit is contained in:
hunjixin 2021-07-06 13:34:54 +08:00
parent ac03c01e4a
commit a48a6a168a
2 changed files with 11 additions and 6 deletions

View File

@ -806,6 +806,11 @@ workflows:
suite: itest-gateway
target: "./itests/gateway_test.go"
- test:
name: test-itest-get_messages_in_ts
suite: itest-get_messages_in_ts
target: "./itests/get_messages_in_ts_test.go"
- test:
name: test-itest-multisig
suite: itest-multisig

View File

@ -39,14 +39,14 @@ func TestChainGetMessagesInTs(t *testing.T) {
waitAllCh := make(chan struct{})
go func() {
headChangeCh , err := client.ChainNotify(ctx)
headChangeCh, err := client.ChainNotify(ctx)
require.NoError(t, err)
<- headChangeCh //skip hccurrent
<-headChangeCh //skip hccurrent
count := 0
for {
select {
case headChanges := <- headChangeCh:
case headChanges := <-headChangeCh:
for _, change := range headChanges {
if change.Type == store.HCApply {
msgs, err := client.ChainGetMessagesInTipset(ctx, change.Val.Key())
@ -78,9 +78,9 @@ func TestChainGetMessagesInTs(t *testing.T) {
}
select {
case <- waitAllCh:
case <- time.After(time.Minute):
t.Errorf("timeout to wait for pack messages")
case <-waitAllCh:
case <-time.After(time.Minute):
t.Errorf("timeout to wait for pack messages")
}
for _, sm := range sms {