ipfs / go-bitswap

The golang implementation of the bitswap protocol
MIT License
216 stars 112 forks source link

TestTaggingUseful failed to pass #472

Closed zeigo closed 2 years ago

zeigo commented 3 years ago

engine_test.go:1073: Peers should be tagged but weren't --- FAIL: TestTaggingUseful (0.05s)

The error happens when i = 1. I print some info before the following line https://github.com/ipfs/go-bitswap/blob/0fa397581ca6197c6c4ca17842719370f6596e95/internal/decision/scoreledger.go#L166 and find at some time, lastExchange equals lastShortUpdate, so the update is missed

lastExchange:  2021-04-03 15:53:35.5523618 +0800 CST m=+0.032325301
lastShortUpdate:  2021-04-03 15:53:35.5523618 +0800 CST m=+0.032325301

I think if !l.lastExchange.Before(lastShortUpdate) would be better?

welcome[bot] commented 3 years ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

BigLep commented 2 years ago

Closing given corresponding fix PR was merged.