From 5b5df855b2cc2f12ea8e1298e1ebee5cfe6b598a Mon Sep 17 00:00:00 2001 From: Hweinstock <42325418+Hweinstock@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:08:37 -0500 Subject: [PATCH] test(perf): update thresholds in buildIndex tests (#6228) ## Problem Performance test was reliant on dead code removed in https://github.com/aws/aws-toolkit-vscode/pull/6218 ## Solution - update thresholds to accommodate the change. --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). License: I confirm that my contribution is made under the terms of the Apache 2.0 license. --- packages/core/src/testInteg/perf/buildIndex.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/core/src/testInteg/perf/buildIndex.test.ts b/packages/core/src/testInteg/perf/buildIndex.test.ts index e8c469db4bc..d60de3bdc3a 100644 --- a/packages/core/src/testInteg/perf/buildIndex.test.ts +++ b/packages/core/src/testInteg/perf/buildIndex.test.ts @@ -10,7 +10,7 @@ import assert from 'assert' import { LspClient, LspController } from '../../amazonq' import { LanguageClient, ServerOptions } from 'vscode-languageclient' import { createTestWorkspace } from '../../test/testUtil' -import { BuildIndexRequestType, GetRepomapIndexJSONRequestType, GetUsageRequestType } from '../../amazonq/lsp/types' +import { BuildIndexRequestType, GetUsageRequestType } from '../../amazonq/lsp/types' import { fs, getRandomString } from '../../shared' import { FileSystem } from '../../shared/fs/fs' import { getFsCallsUpperBound } from './utilities' @@ -22,11 +22,10 @@ interface SetupResult { } async function verifyResult(setup: SetupResult) { - // A correct run makes 3 requests, but don't want to make it exact to avoid over-sensitivity to implementation. If we make 10+ something is likely wrong. - assert.ok(setup.clientReqStub.callCount >= 3 && setup.clientReqStub.callCount <= 10) + // A correct run makes 2 requests, but don't want to make it exact to avoid over-sensitivity to implementation. If we make 10+ something is likely wrong. + assert.ok(setup.clientReqStub.callCount >= 2 && setup.clientReqStub.callCount <= 10) assert.ok(setup.clientReqStub.calledWith(BuildIndexRequestType)) assert.ok(setup.clientReqStub.calledWith(GetUsageRequestType)) - assert.ok(setup.clientReqStub.calledWith(GetRepomapIndexJSONRequestType)) assert.strictEqual(getFsCallsUpperBound(setup.fsSpy), 0, 'should not make any fs calls') assert.ok(setup.findFilesSpy.callCount <= 2, 'findFiles should not be called more than twice')