hunk.code_window:     "compile": "rimraf ./build && tsc",
       "watch": "./node_modules/.bin/tsc -w",
       "package": "gulp package",
       "lint": "eslint -c ./.eslintrc.js src/**/*.ts test/**/*.ts sample/**/*.ts",
       "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1"
     },
  
hunk.labels: keep keep add keep keep keep
hunk.after_edit:     "pack": "gulp pack",
  
hunk.file_path: package.json
hunk.type: add
file: import "reflect-metadata";
  import { createTestingConnections, closeTestingConnections, reloadTestingDatabases } from "../../utils/test-utils";
  import { Connection } from "../../../src/connection/Connection";
  import { PostgresDriver } from "../../../src/driver/postgres/PostgresDriver";
  import { expect } from "chai";
  
  describe("github issues > #6958 Promises never get resolved in specific cases", () => {
  
      let connections: Connection[];
      before(async () => connections = await createTestingConnections({
          enabledDrivers: ["postgres"],
      }));
      beforeEach(() => reloadTestingDatabases(connections));
      after(() => closeTestingConnections(connections));
  
      it("should release all used query runners upon disconnection", () => Promise.all(connections.map(async connection => {
          const runner1 = connection.createQueryRunner();
          await runner1.query("SELECT 1 as foo;"); // dummy query to ensure that a database connection is established
          const runner2 = connection.createQueryRunner();
          await runner2.query("SELECT 2 as foo;");
  
          await connection.close();
  
          expect(runner1.isReleased).to.be.true;
          expect(runner2.isReleased).to.be.true;
          expect((connection.driver as PostgresDriver).connectedQueryRunners.length).to.equal(0);
      })));
  });
  