Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[util-dns]: unit tests are failing in Node.js v20.3.0 #4825

Closed
3 tasks done
trivikr opened this issue Jun 12, 2023 · 1 comment · Fixed by #4844
Closed
3 tasks done

[util-dns]: unit tests are failing in Node.js v20.3.0 #4825

trivikr opened this issue Jun 12, 2023 · 1 comment · Fixed by #4844
Labels
bug This issue is a bug. p2 This is a standard priority issue queued This issues is on the AWS team's backlog

Comments

@trivikr
Copy link
Member

trivikr commented Jun 12, 2023

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.0

Observed Behavior

$ util-dns> yarn test
yarn 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.ts

Test Suites: 2 failed, 5 passed, 7 total
Tests:       32 failed, 2 skipped, 23 passed, 57 total
Snapshots:   0 total
Time:        3.545 s, estimated 4 s
Ran 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 total
Tests:       2 skipped, 55 passed, 57 total
Snapshots:   0 total
Time:        3.284 s, estimated 4 s
Ran all test suites.
✨  Done in 3.83s.

Possible Solution

No response

Additional Information/Context

No response

@trivikr trivikr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 12, 2023
@RanVaknin RanVaknin added p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jun 12, 2023
@yenfryherrerafeliz yenfryherrerafeliz added the queued This issues is on the AWS team's backlog label Jun 13, 2023
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. p2 This is a standard priority issue queued This issues is on the AWS team's backlog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants