fix tests
This commit is contained in:
parent
c83776e510
commit
01ff290f85
|
@ -283,7 +283,7 @@ export async function refreshRandomPool(forceRefresh = false): Promise<void> {
|
|||
// we don't have nodes to fetch the pool from them, so call the seed node instead.
|
||||
if (randomSnodePool.length < minSnodePoolCount) {
|
||||
window?.log?.info(
|
||||
`refreshRandomPool: NOT enough snodes to fetch from them, so falling back to seedNodes ${seedNodes?.length}`
|
||||
`refreshRandomPool: NOT enough snodes to fetch from them ${randomSnodePool.length} < ${minSnodePoolCount}, so falling back to seedNodes ${seedNodes?.length}`
|
||||
);
|
||||
|
||||
randomSnodePool = await exports.refreshRandomPoolDetail(seedNodes);
|
||||
|
|
|
@ -68,7 +68,7 @@ describe('OnionPathsErrors', () => {
|
|||
|
||||
beforeEach(async () => {
|
||||
guardPubkeys = TestUtils.generateFakePubKeys(3).map(n => n.key);
|
||||
otherNodesPubkeys = TestUtils.generateFakePubKeys(9).map(n => n.key);
|
||||
otherNodesPubkeys = TestUtils.generateFakePubKeys(12).map(n => n.key);
|
||||
|
||||
SNodeAPI.Onions.resetSnodeFailureCount();
|
||||
|
||||
|
|
|
@ -112,6 +112,20 @@ const fakeSnodePool = [
|
|||
pubkey_ed25519: 'e3ec6fcc79e64c2af6a48a9865d4bf4b739ec7708d75f35acc3d478f91615356',
|
||||
version: '',
|
||||
},
|
||||
{
|
||||
ip: '136.243.103.183',
|
||||
port: 22116,
|
||||
pubkey_x25519: '0f78775bf189a6eaca2f9c873524832aae8e87a5bf792fb394df97b21173f50c',
|
||||
pubkey_ed25519: 'e3ec6fcc79e64c2af6a48a9865d4bf4b739ec7708d75f35acc3d478f91615357',
|
||||
version: '',
|
||||
},
|
||||
{
|
||||
ip: '136.243.103.183',
|
||||
port: 22116,
|
||||
pubkey_x25519: '0f78775bf189a6eaca2f9c873524832aae8e87a5bf792fb394df97b21173f50c',
|
||||
pubkey_ed25519: 'e3ec6fcc79e64c2af6a48a9865d4bf4b739ec7708d75f35acc3d478f91615358',
|
||||
version: '',
|
||||
},
|
||||
];
|
||||
|
||||
const fakeGuardNodesEd25519 = [guard1ed, guard2ed, guard3ed];
|
||||
|
@ -130,7 +144,15 @@ describe('OnionPaths', () => {
|
|||
sandbox.stub(OnionPaths, 'selectGuardNodes').resolves(fakeGuardNodes);
|
||||
sandbox.stub(SNodeAPI.SNodeAPI, 'getSnodePoolFromSnode').resolves(fakeGuardNodes);
|
||||
TestUtils.stubData('getGuardNodes').resolves(fakeGuardNodesEd25519);
|
||||
TestUtils.stubData('createOrUpdateItem').resolves();
|
||||
TestUtils.stubWindow('getSeedNodeList', () => ['seednode1']);
|
||||
// tslint:disable: no-void-expression no-console
|
||||
|
||||
TestUtils.stubWindow('log', {
|
||||
info: (args: any) => console.info(args),
|
||||
warn: (args: any) => console.warn(args),
|
||||
error: (args: any) => console.error(args),
|
||||
});
|
||||
|
||||
sandbox.stub(SNodeAPI.SnodePool, 'refreshRandomPoolDetail').resolves(fakeSnodePool);
|
||||
SNodeAPI.Onions.resetSnodeFailureCount();
|
||||
|
|
Loading…
Reference in New Issue