Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: fix flaky pubsub test #3761

Merged
merged 1 commit into from
Jul 27, 2021
Merged

fix: fix flaky pubsub test #3761

merged 1 commit into from
Jul 27, 2021

Commits on Jul 27, 2021

  1. fix: fix flaky pubsub test

    In the http client, when we subscribe to a topic we open a HTTP connection
    which we keep open for the duration of the subscription.
    
    When we unsubscribe we abort the connection but it can remain open for a
    little while after the abort, even if we try to wait on the `fetch` command
    ending before continuting, which leads to the topic still being present in the
    subs list, so retry asserting that the subs list is empty in the tests within
    a certain time window.
    
    Fixes this sort of error:
    
    ```
    ipfs:   1) interface-ipfs-core over ipfs-http-client tests against go-ipfs
    ipfs:        .pubsub.unsubscribe
    ipfs:          should subscribe 5 handlers and unsubscribe once with no reference to the handlers:
    ipfs:       AssertionError: expected [ Array(1) ] to deeply equal []
    ipfs:       + expected - actual
    ipfs:       -[
    ipfs:       -  "pubsub-tests-SVOFzpM5DtbcI7jBETrmm"
    ipfs:       -]
    ipfs:       +[]
    ```
    achingbrain committed Jul 27, 2021
    Configuration menu
    Copy the full SHA
    d12f3df View commit details
    Browse the repository at this point in the history