doc: add stm annotations to the syncer tests
Add annotations for the test crawler for the lotus.systemtestmatrix.com dashboard.
This commit is contained in:
parent
ae66f57fa0
commit
34bfd13548
@ -249,7 +249,8 @@ func TestSyncManagerBucketSet(t *testing.T) {
|
|||||||
bucketSet := syncBucketSet{buckets: []*syncTargetBucket{bucket1}}
|
bucketSet := syncBucketSet{buckets: []*syncTargetBucket{bucket1}}
|
||||||
fmt.Println("bucketSet: ", bucketSet.String())
|
fmt.Println("bucketSet: ", bucketSet.String())
|
||||||
|
|
||||||
// inserting a tipset from an existing chain, should add to an existing bucket
|
// inserting a tipset (potential sync target) from an existing chain, should add to an existing bucket
|
||||||
|
//stm: @CHAIN_SYNCER_ADD_SYNC_TARGET_001
|
||||||
ts3 := mock.TipSet(mock.MkBlock(ts2, 2, 0))
|
ts3 := mock.TipSet(mock.MkBlock(ts2, 2, 0))
|
||||||
bucketSet.Insert(ts3)
|
bucketSet.Insert(ts3)
|
||||||
require.Equal(t, 1, len(bucketSet.buckets))
|
require.Equal(t, 1, len(bucketSet.buckets))
|
||||||
@ -264,7 +265,8 @@ func TestSyncManagerBucketSet(t *testing.T) {
|
|||||||
require.Equal(t, 1, len(bucketSet.buckets[1].tips))
|
require.Equal(t, 1, len(bucketSet.buckets[1].tips))
|
||||||
fmt.Println("bucketSet: ", bucketSet.String())
|
fmt.Println("bucketSet: ", bucketSet.String())
|
||||||
|
|
||||||
// Pop removes the best bucket, e.g. bucket1
|
// Pop removes the best bucket (best sync target), e.g. bucket1
|
||||||
|
//stm: @CHAIN_SYNCER_SELECT_SYNC_TARGET_001
|
||||||
popped := bucketSet.Pop()
|
popped := bucketSet.Pop()
|
||||||
require.Equal(t, popped, bucket1)
|
require.Equal(t, popped, bucket1)
|
||||||
require.Equal(t, 1, len(bucketSet.buckets))
|
require.Equal(t, 1, len(bucketSet.buckets))
|
||||||
|
@ -1108,6 +1108,7 @@ func TestIncomingBlocks(t *testing.T) {
|
|||||||
require.NoError(t, tu.mn.LinkAll())
|
require.NoError(t, tu.mn.LinkAll())
|
||||||
|
|
||||||
clientNode := tu.nds[client]
|
clientNode := tu.nds[client]
|
||||||
|
//stm: @CHAIN_SYNCER_INCOMING_BLOCKS_001
|
||||||
incoming, err := clientNode.SyncIncomingBlocks(tu.ctx)
|
incoming, err := clientNode.SyncIncomingBlocks(tu.ctx)
|
||||||
require.NoError(tu.t, err)
|
require.NoError(tu.t, err)
|
||||||
|
|
||||||
@ -1151,6 +1152,7 @@ func TestSyncManualBadTS(t *testing.T) {
|
|||||||
|
|
||||||
require.True(tu.t, !sourceHead.Equals(clientHead), "source and client should be out of sync in test setup")
|
require.True(tu.t, !sourceHead.Equals(clientHead), "source and client should be out of sync in test setup")
|
||||||
|
|
||||||
|
//stm: @CHAIN_SYNCER_MARK_BAD_001
|
||||||
err = tu.nds[client].SyncMarkBad(tu.ctx, sourceHead.Cids()[0])
|
err = tu.nds[client].SyncMarkBad(tu.ctx, sourceHead.Cids()[0])
|
||||||
require.NoError(tu.t, err)
|
require.NoError(tu.t, err)
|
||||||
|
|
||||||
@ -1158,6 +1160,7 @@ func TestSyncManualBadTS(t *testing.T) {
|
|||||||
err = tu.nds[client].SyncMarkBad(tu.ctx, sourceHeadParent)
|
err = tu.nds[client].SyncMarkBad(tu.ctx, sourceHeadParent)
|
||||||
require.NoError(tu.t, err)
|
require.NoError(tu.t, err)
|
||||||
|
|
||||||
|
//stm: @CHAIN_SYNCER_CHECK_BAD_001
|
||||||
reason, err := tu.nds[client].SyncCheckBad(tu.ctx, sourceHead.Cids()[0])
|
reason, err := tu.nds[client].SyncCheckBad(tu.ctx, sourceHead.Cids()[0])
|
||||||
require.NoError(tu.t, err)
|
require.NoError(tu.t, err)
|
||||||
require.NotEqual(tu.t, "", reason, "block is not bad after manually marking")
|
require.NotEqual(tu.t, "", reason, "block is not bad after manually marking")
|
||||||
@ -1179,6 +1182,7 @@ func TestSyncManualBadTS(t *testing.T) {
|
|||||||
|
|
||||||
// Assertion 2:
|
// Assertion 2:
|
||||||
// - after unmarking blocks as bad and reconnecting, source & client should be in sync
|
// - after unmarking blocks as bad and reconnecting, source & client should be in sync
|
||||||
|
//stm: @CHAIN_SYNCER_UNMARK_BAD_001
|
||||||
err = tu.nds[client].SyncUnmarkBad(tu.ctx, sourceHead.Cids()[0])
|
err = tu.nds[client].SyncUnmarkBad(tu.ctx, sourceHead.Cids()[0])
|
||||||
require.NoError(tu.t, err)
|
require.NoError(tu.t, err)
|
||||||
|
|
||||||
@ -1223,6 +1227,7 @@ func TestSyncState(t *testing.T) {
|
|||||||
activeSyncs := []api.ActiveSync{}
|
activeSyncs := []api.ActiveSync{}
|
||||||
|
|
||||||
for len(activeSyncs) == 0 {
|
for len(activeSyncs) == 0 {
|
||||||
|
//stm: @CHAIN_SYNCER_STATE_001
|
||||||
state, err = clientNode.SyncState(tu.ctx)
|
state, err = clientNode.SyncState(tu.ctx)
|
||||||
require.NoError(tu.t, err)
|
require.NoError(tu.t, err)
|
||||||
activeSyncs = state.ActiveSyncs
|
activeSyncs = state.ActiveSyncs
|
||||||
|
Loading…
Reference in New Issue
Block a user