You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The unit tests of util-dns throw multiple TypeErrors.
For example:
TypeError: Cannot assign to read only property 'performance' of object '[object global]'
This may or may not have impact SDK usage. The unit test needs to be fixed.
SDK version number
main
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.3.0
Reproduction Steps
Run unit tests for util-dns in Node.js v20.3.0
Observed Behavior
$ util-dns> yarn testyarn run v1.22.17
$ jest PASS src/HostResolver.spec.ts PASS src/util/HostEntryTable.spec.ts FAIL src/util/HostEntry.spec.ts ● HostEntry › updateRecords(addresses, expirationTtlMs) › updates the nextTimestampToProcessMs and expirationTtlMs TypeError: Cannot assign to read only property 'performance' of object '[object global]' 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at hijackMethod (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:946:32) at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1733:17) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › updateRecords(addresses, expirationTtlMs) › adds new addresses to success records TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › updateRecords(addresses, expirationTtlMs) › dedupes addresses to success records TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › updateRecords(addresses, expirationTtlMs) › updates the expirationTtlMs of an existing good address TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › updateRecords(addresses, expirationTtlMs) › updates the expirationTtlMs of an existing failed address TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › processRecords() › removes expired records from good records except 1 good record TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › processRecords() › removes expired records from failed records except 1 failed record TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › processRecords() › promotes a failed address if there are no good addresses and not expired TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › processRecords() › does not promote any expired failed addresses if there are no good addresses TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › failAddressInRecords(address) › moves failed addresses to failed records TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › failAddressInRecords(address) › noop if failed address is not in good records TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) ● HostEntry › failAddressInRecords(address) › noop if failed address is already in bad records TypeError: Can't install fake timers twice on the same global object. 35 | 36 | beforeEach(() => { > 37 | jest.useFakeTimers(); | ^ 38 | hostEntry = new HostEntry(Date.now()); 39 | expirationTtlMs = Date.now() + EXPIRATION_OFFSET_MS; 40 | addresses = [HOST_ADDRESS_A_0, HOST_ADDRESS_A_1, HOST_ADDRESS_AAAA_0, HOST_ADDRESS_AAAA_1]; at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/util/HostEntry.spec.ts:37:10) PASS src/util/HostAddressEntryCollection.spec.ts FAIL src/NodeDnsLookupHostResolver.spec.ts ● NodeDnsLookupHostResolver › is configurable › constructors TypeError: Cannot assign to read only property 'performance' of object '[object global]' 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at hijackMethod (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:946:32) at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1733:17) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should return itself with a valid IPv4 address TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should return itself with a valid IPv6 address TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should throw an ENOTFOUND error on an invalid host name TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should throw an error on an unsupported Node DNS family TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should throw an error for an empty list TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should throw an error if initial resolution fails TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should return a pair of IPv4 and IPv6 addresses for a valid host name TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should return only one IPv4 address for a valid host name if only IPv4 is available TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should return only one IPv6 address for a valid host name if only IPv6 is available TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should return the next available pair of IPv4 and IPv6 address in the cache TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should return next pair even when updating addresses fails and is not expired TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should return next pair even when updating addresses and is not expired TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should return a pair by upgrading one non-expired bad record if there are no good records TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › resolveAddress(args) › resolveAddress(args) should fail if there are no good records and the bad records are expired TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › reportFailureOnAddress(addr) › reportFailureOnAddress(addr) should throw when host name is not in cache TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › reportFailureOnAddress(addr) › reportFailureOnAddress(addr) should move reported addresses to failure cache TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › purgeCache(args?) › purgeCache(args) should noop for a non-cached host name TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › purgeCache(args?) › purgeCache(args) should clear the cache for a host name if provided TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) ● NodeDnsLookupHostResolver › purgeCache(args?) › purgeCache() should clear the cache if no args are provided TypeError: Can't install fake timers twice on the same global object. 39 | let TEST_HOST_RESOLVER: NodeDnsLookupHostResolver; 40 | beforeEach(() => { > 41 | jest.useFakeTimers(); | ^ 42 | TEST_HOST_RESOLVER_TABLE = new HostEntryTable(); 43 | TEST_HOST_RESOLVER = new NodeDnsLookupHostResolver({ 44 | cache: TEST_HOST_RESOLVER_TABLE, at Object.install (../../node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:1642:19) at FakeTimers.useFakeTimers (../../node_modules/@jest/fake-timers/build/modernFakeTimers.js:110:36) at Object.<anonymous> (src/NodeDnsLookupHostResolver.spec.ts:41:10) PASS src/archive/NodeDnsResolveHostResolver.spec.ts PASS src/HostResolver.browser.spec.tsTest Suites: 2 failed, 5 passed, 7 totalTests: 32 failed, 2 skipped, 23 passed, 57 totalSnapshots: 0 totalTime: 3.545 s, estimated 4 sRan all test suites.error Command failed with exit code 1.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Expected Behavior
$ util-dns> yarn test...Test Suites: 7 passed, 7 totalTests: 2 skipped, 55 passed, 57 totalSnapshots: 0 totalTime: 3.284 s, estimated 4 sRan all test suites.✨ Done in 3.83s.
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered:
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Checkboxes for prior research
Describe the bug
The unit tests of util-dns throw multiple TypeErrors.
For example:
TypeError: Cannot assign to read only property 'performance' of object '[object global]'
This may or may not have impact SDK usage. The unit test needs to be fixed.
SDK version number
main
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.3.0
Reproduction Steps
Run unit tests for
util-dns
in Node.js v20.3.0Observed Behavior
Expected Behavior
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: