Hotfix span selection (#110)

Fix an issue in span selection that was introduced in #106
pull/111/head^2
justheuristic 1 year ago committed by GitHub
parent a2066a4096
commit 8dc0f513ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -86,7 +86,7 @@ class RemoteSequenceInfo:
if (
info is None
or peer_id not in info.servers
or info.servers[peer_id] != ServerState.ONLINE
or info.servers[peer_id].state != ServerState.ONLINE
or block_index == len(block_infos) - 1
):
closed_spans.append(active_spans.pop(peer_id))

@ -29,6 +29,9 @@ def test_sequence_manager_shutdown():
sequence_manager=TestSequenceManager(dht, block_uids, sequential.p2p, _was_shut_down=shutdown_evt, start=True),
)
sequence = sequential.sequence_manager.make_sequence()
assert all(sequence[i].peer_id != sequence[i + 1].peer_id for i in range(len(sequence) - 1))
assert sequential.sequence_manager.is_alive()
assert sequential.sequence_manager._thread.ready.is_set()
assert not shutdown_evt.is_set()

Loading…
Cancel
Save