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

Test fails in v1.43 #23665

Open
ker0olos opened this issue May 3, 2024 · 1 comment
Open

Test fails in v1.43 #23665

ker0olos opened this issue May 3, 2024 · 1 comment
Labels
bug Something isn't working node API polyfill Related to various "node:*" modules APIs node compat

Comments

@ker0olos
Copy link

ker0olos commented May 3, 2024

the following test passes in v1.42.0 but fails in v1.43.1

import {
  afterEach,
  beforeEach,
  describe,
  it,
} from 'https://deno.land/[email protected]/testing/bdd.ts';
import { MongoMemoryServer } from 'npm:mongodb-memory-server-core';
import { MongoClient, ObjectId } from 'npm:mongodb';
import { assert } from 'https://deno.land/[email protected]/assert/assert.ts';

let mongod: MongoMemoryServer;
let client: MongoClient;

describe({
  name: 'deno',
  fn: () => {
    beforeEach(async () => {
      mongod = await MongoMemoryServer.create();
      client = new MongoClient(mongod.getUri());
      await client.connect();
    });

    afterEach(async () => {
      await client.close();
      await mongod.stop();
    });

    it('test', async () => {
      const _id = new ObjectId();

      const { insertedId } = await client.db().collection('test').insertOne({
        _id,
      });

      assert(insertedId.equals(_id));
    });
  },
});
error: Error: connect ECONNREFUSED 127.0.0.1:59453 - Local (undefined:undefined)
    at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:62:9)
    at __node_internal_exceptionWithHostPort (ext:deno_node/internal/errors.ts:148:10)
    at TCPConnectWrap._afterConnect [as oncomplete] (node:net:130:16)
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.

 FAILURES 

./db/deno.test.ts (uncaught error)

FAILED | 0 passed | 2 failed (608ms)

error: Test failed
@ker0olos
Copy link
Author

ker0olos commented May 9, 2024

Still failing in v1.43.2, still not sure why.
Still fails in v1.43.3

@bartlomieju bartlomieju added bug Something isn't working node compat node API polyfill Related to various "node:*" modules APIs labels May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node API polyfill Related to various "node:*" modules APIs node compat
Projects
None yet
Development

No branches or pull requests

2 participants