Skip to content

Commit

Permalink
test: update unit and integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc-bq committed Oct 29, 2024
1 parent 4f93e11 commit cf3ba4e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions pg/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ export class AwsPGClient extends AwsClient {
throw new AwsWrapperError(Messages.get("HostInfo.noHostParameter"));
}
const result: ClientWrapper = await this.pluginManager.connect(hostInfo, this.properties, true);
result.client.on("error", (error: any) => {
this.emit("error", error);
});
await this.pluginService.setCurrentClient(result, result.hostInfo);
await this.internalPostConnect();
});
Expand Down
3 changes: 0 additions & 3 deletions pg/lib/dialect/node_postgres_driver_dialect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ export class NodePostgresDriverDialect implements DriverDialect {

async connect(hostInfo: HostInfo, props: Map<string, any>): Promise<ClientWrapper> {
const targetClient = new Client(WrapperProperties.removeWrapperProperties(props));
targetClient.on("error", (error: any) => {
// targetClient.emit("error", error);
});
await targetClient.connect();
return Promise.resolve(new PgClientWrapper(targetClient, hostInfo, props));
}
Expand Down
3 changes: 2 additions & 1 deletion pg/lib/pg_pool_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Pool, PoolClient, PoolConfig } from "pg";
import { AwsPoolClient } from "../../common/lib/aws_pool_client";
import { Messages } from "../../common/lib/utils/messages";
import { AwsWrapperError } from "../../common/lib/utils/errors";
import { logger } from "../../common/logutils";

export class AwsPgPoolClient implements AwsPoolClient {
targetPool: Pool;
Expand All @@ -26,7 +27,7 @@ export class AwsPgPoolClient implements AwsPoolClient {
this.targetPool = new Pool(props);
this.targetPool.on("connect", (_client: PoolClient) => {
_client.on("error", (err: Error) => {
console.log(err);
logger.debug(err);
});
});
}
Expand Down

0 comments on commit cf3ba4e

Please sign in to comment.