From a48a6a168a43abc378c787cc76e58a09495bb047 Mon Sep 17 00:00:00 2001 From: hunjixin <1084400399@qq.com> Date: Tue, 6 Jul 2021 13:34:54 +0800 Subject: [PATCH] add test for new api --- .circleci/config.yml | 5 +++++ itests/get_messages_in_ts_test.go | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 50f1b1696..4a69a4a49 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/itests/get_messages_in_ts_test.go b/itests/get_messages_in_ts_test.go index b3810df1e..314ceeb1c 100644 --- a/itests/get_messages_in_ts_test.go +++ b/itests/get_messages_in_ts_test.go @@ -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 {