Skip to content

Commit 44bb38f

Browse files
committed
fix(telemetry): prettier + restore strict e2e refcount assertions
- Re-apply prettier formatting on lib/DBSQLClient.ts, lib/result/CloudFetchResultHandler.ts, lib/result/RowSetProvider.ts (eslint --fix in the prior commit re-introduced quote/destructuring formatting that prettier rewrote back). - Revert the loosening of the "share telemetry client across multiple connections" e2e assertions back to exact-count form now that the PECO test workspace's telemetry feature flag is on. Strict count catches refcount regressions an at.least() assertion would hide. Co-authored-by: Isaac Signed-off-by: samikshya-chand_data <samikshya.chand@databricks.com>
1 parent 4750bc2 commit 44bb38f

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

lib/DBSQLClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient, I
314314
* attribution is better off seeing a missing field than a wrong value.
315315
*/
316316
private extractWorkspaceId(): string | undefined {
317-
const {httpPath} = this;
317+
const { httpPath } = this;
318318
if (!httpPath) {
319319
return undefined;
320320
}

lib/result/CloudFetchResultHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default class CloudFetchResultHandler implements IResultsProvider<ArrowBa
141141
* CRITICAL: All exceptions swallowed and logged at LogLevel.debug ONLY.
142142
*/
143143
private emitCloudFetchChunk(chunkIndex: number, latencyMs: number, bytes: number): void {
144-
const {statementId} = this;
144+
const { statementId } = this;
145145
if (!statementId) {
146146
return;
147147
}

lib/result/RowSetProvider.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export default class RowSetProvider implements IResultsProvider<TRowSet | undefi
168168
* CRITICAL: All exceptions swallowed and logged at LogLevel.debug ONLY.
169169
*/
170170
private emitChunkEvent(latencyMs: number, response: TFetchResultsResp): void {
171-
const {statementId} = this;
171+
const { statementId } = this;
172172
if (!statementId) {
173173
return;
174174
}
@@ -184,19 +184,19 @@ export default class RowSetProvider implements IResultsProvider<TRowSet | undefi
184184
// - `columns[i].*Val.values` — COLUMN_BASED_SET, sum across columns
185185
// - `rows[i]` — legacy row-based set (rare; estimate)
186186
let bytes = 0;
187-
const {results} = response;
187+
const { results } = response;
188188
if (results) {
189-
const {arrowBatches} = results;
189+
const { arrowBatches } = results;
190190
if (arrowBatches) {
191191
for (const batch of arrowBatches) {
192192
bytes += batch.batch?.length ?? 0;
193193
}
194194
}
195-
const {binaryColumns} = results;
195+
const { binaryColumns } = results;
196196
if (binaryColumns) {
197197
bytes += binaryColumns.length;
198198
}
199-
const {columns} = results;
199+
const { columns } = results;
200200
if (columns) {
201201
for (const column of columns) {
202202
bytes += estimateColumnBytes(column);

tests/e2e/telemetry/telemetry-integration.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,12 @@ describe('Telemetry Integration', function () {
195195
telemetryEnabled: true,
196196
});
197197

198-
// Both clients should call getOrCreateClient exactly once each.
199-
// Tightened from `at.least(2)` to `equal(2)` — under the previous
200-
// assertion an off-by-one refcount leak (e.g. an extra call from a
201-
// reconnect path) would not fail the test.
198+
// Each connect calls getOrCreateClient exactly once when the feature
199+
// flag is on (no FF-disabled release path). Tightened from
200+
// `at.least(2)` to `equal(2)` — an off-by-one refcount leak from a
201+
// reconnect path would now fail the test.
202202
expect(getOrCreateClientSpy.callCount).to.equal(2);
203-
// Both calls should target the same host so the singleton actually shares.
203+
// Both calls must target the same host so the singleton actually shares.
204204
const host1 = getOrCreateClientSpy.firstCall.args[1];
205205
const host2 = getOrCreateClientSpy.secondCall.args[1];
206206
expect(host1).to.equal(host2);

0 commit comments

Comments
 (0)