orbs-network / orbs-network-go

Orbs node virtual chain core reference implementation in Go
MIT License
48 stars 12 forks source link

Flakiness in block sync tests #160

Closed talkol closed 6 years ago

talkol commented 6 years ago

Might be a good idea to also add context to all the tests in block sync when fixing this issue

This failure some times happens on my machine:

=== RUN   TestSyncSourceHandlesBlockAvailabilityRequest
info 2018-09-01T22:10:30.792389Z broadcast block availability request flow=block-sync first-block-height=1 last-block-height=2710 function=blockstorage.(*BlockSync).petitionerBroadcastBlockAvailabilityRequest source=services/blockstorage/block_sync.go:180 
info 2018-09-01T22:10:30.792523Z Trying to commit a block service=block-storage block-height=1 function=blockstorage.(*service).CommitBlock source=services/blockstorage/service.go:80 
info 2018-09-01T22:10:30.792553Z Committed a block service=block-storage block-height=1 function=blockstorage.(*service).CommitBlock source=services/blockstorage/service.go:101 
info 2018-09-01T22:10:30.792727Z Trying to commit a block service=block-storage block-height=2 function=blockstorage.(*service).CommitBlock source=services/blockstorage/service.go:80 
info 2018-09-01T22:10:30.792765Z Committed a block service=block-storage block-height=2 function=blockstorage.(*service).CommitBlock source=services/blockstorage/service.go:101 
info 2018-09-01T22:10:30.793972Z received block availability request flow=block-sync sender={SenderPublicKey:70d92324eb8d24b7c7ed646e1996f94dcd52934a031935b9ac2d0e5bbcfa357c,Signature:,} function=blockstorage.(*BlockSync).sourceHandleBlockAvailabilityRequest source=services/blockstorage/block_sync.go:264 
info 2018-09-01T22:10:30.794717Z broadcast block availability request flow=block-sync first-block-height=3 last-block-height=2712 function=blockstorage.(*BlockSync).petitionerBroadcastBlockAvailabilityRequest source=services/blockstorage/block_sync.go:180 
--- FAIL: TestSyncSourceHandlesBlockAvailabilityRequest (0.00s)
    require.go:794: 
            Error Trace:    harness.go:53
                                        block_sync_test.go:55
            Error:          Received unexpected error:
                            Function #3 SendBlockAvailabilityResponse executed 0 times, expected: 1
            Test:           TestSyncSourceHandlesBlockAvailabilityRequest
talkol commented 6 years ago

Fixed in https://github.com/orbs-network/orbs-network-go/pull/165/files