Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Jan 18, 2025
1 parent d8fb737 commit 2a8ca8f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions yarn-project/p2p/src/services/peer_manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ describe('PeerManager', () => {
// Set the peer scores to trigger different states
peerManager.penalizePeer(bannedPeerId, PeerErrorSeverity.LowToleranceError); // Will set score below -100
peerManager.penalizePeer(bannedPeerId, PeerErrorSeverity.LowToleranceError); // Additional penalty to ensure banned state
peerManager.penalizePeer(bannedPeerId, PeerErrorSeverity.HighToleranceError);

peerManager.penalizePeer(disconnectPeerId, PeerErrorSeverity.LowToleranceError); // Will set score between -100 and -50
peerManager.penalizePeer(disconnectPeerId, PeerErrorSeverity.HighToleranceError);
Expand All @@ -315,6 +316,7 @@ describe('PeerManager', () => {
ReqRespSubProtocol.GOODBYE,
Buffer.from([GoodByeReason.DISCONNECTED]),
);

// Verify that hangUp was not called for the healthy peer
expect(mockLibP2PNode.hangUp).not.toHaveBeenCalledWith(healthyPeerId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { type PeerId } from '@libp2p/interface';
import { type MockProxy, mock } from 'jest-mock-extended';

import { type PeerScoring } from '../../peer-scoring/peer_scoring.js';
import { type PeerManager } from '../../peer_manager.js';
import { ReqRespSubProtocol, type ReqRespSubProtocolRateLimits } from '../interface.js';
import { RequestResponseRateLimiter } from './rate_limiter.js';

Expand Down
1 change: 0 additions & 1 deletion yarn-project/p2p/src/services/reqresp/reqresp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
stopNodes,
} from '../../mocks/index.js';
import { type PeerScoring } from '../peer-scoring/peer_scoring.js';
import { type PeerManager } from '../peer_manager.js';
import { ReqRespSubProtocol, RequestableBuffer } from './interface.js';
import { GoodByeReason } from './protocols/goodbye.js';

Expand Down

0 comments on commit 2a8ca8f

Please sign in to comment.