From a5a0cd7c734d1cd911b7d8d6b0fc659283fc8719 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 5 Nov 2024 10:25:28 -0500 Subject: [PATCH] fix(v2): Pass `responseTimeout` in z/OSMF MVS and USS API calls (#3295) * fix: use responseTimeout in z/OSMF MVS and USS API calls Signed-off-by: Trae Yelovich * tests: resolve failing cases in ZE Signed-off-by: Trae Yelovich --------- Signed-off-by: Trae Yelovich --- packages/zowe-explorer-api/CHANGELOG.md | 2 + .../ZoweExplorerZosmfApi.unit.test.ts | 104 +++++++++++------- .../src/profiles/ZoweExplorerZosmfApi.ts | 75 +++++++++---- .../api/ZoweExplorerZosmfApi.unit.test.ts | 8 +- .../ZoweExplorerZosmfApi.unit.test.ts.snap | 4 + 5 files changed, 131 insertions(+), 62 deletions(-) diff --git a/packages/zowe-explorer-api/CHANGELOG.md b/packages/zowe-explorer-api/CHANGELOG.md index c4f9eeb100..048e04fcc4 100644 --- a/packages/zowe-explorer-api/CHANGELOG.md +++ b/packages/zowe-explorer-api/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t ### Bug fixes +- Fixed an issue where the `responseTimeout` profile property was ignored for z/OSMF MVS and USS API calls. [#3225](https://github.com/zowe/zowe-explorer-vscode/issues/3225) + ## `2.18.0` ### Bug fixes diff --git a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ZoweExplorerZosmfApi.unit.test.ts b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ZoweExplorerZosmfApi.unit.test.ts index 76b1fb80c6..48e9ef33d6 100644 --- a/packages/zowe-explorer-api/__tests__/__unit__/profiles/ZoweExplorerZosmfApi.unit.test.ts +++ b/packages/zowe-explorer-api/__tests__/__unit__/profiles/ZoweExplorerZosmfApi.unit.test.ts @@ -15,15 +15,21 @@ import { ZoweExplorerApi } from "../../../src/profiles/ZoweExplorerApi"; import { ZosmfCommandApi, ZosmfJesApi, ZosmfMvsApi, ZosmfUssApi } from "../../../src/profiles/ZoweExplorerZosmfApi"; import { permStringToOctal } from "../../../src/utils/files"; +type ParametersWithProfileArgs = F extends (...args: infer P) => any ? [...Parameters, profileProperties?: object] : never; + type ITestApi = { [K in keyof T]: { name: K; spy: jest.SpyInstance; - args: jest.ArgsType; - transform?: (args: jest.ArgsType) => any[]; + args: ParametersWithProfileArgs; + transform?: (args: ParametersWithProfileArgs) => any[]; }; }[keyof T]; +const fakeProperties = { + responseTimeout: 60, +}; + type ITestProfile = { host: string; port: number; @@ -40,7 +46,15 @@ const fakeProfile: ITestProfile = { rejectUnauthorized: true, user: "admin", password: "123456", + ...fakeProperties, }; +const loadedProfile: zowe.imperative.IProfileLoaded = { + profile: fakeProfile, + message: "", + type: "zosmf", + failNotFound: false, +}; + const fakeSession = zowe.imperative.Session.createFromUrl(new URL("https://example.com")); async function expectApiWithSession({ name, spy, args, transform }: ITestApi, apiInstance: ZoweExplorerApi.ICommon): Promise { @@ -68,20 +82,22 @@ describe("ZosmfUssApi", () => { password: "password", protocol: "http", user: "aZosmfUser", + ...fakeProperties, }, } as zowe.imperative.IProfileLoaded; it("should include profile properties in the built session object", () => { - const api = new ZosmfUssApi(); + const api = new ZosmfUssApi(loadedProfile); const transformedProps = { ...exampleProfile.profile, hostname: exampleProfile.profile?.host }; + delete transformedProps["responseTimeout"]; delete transformedProps["host"]; expect((api as any)._getSession(exampleProfile).mISession).toMatchObject(transformedProps); }); }); describe("updateAttributes", () => { - const ussApi = new ZosmfUssApi(); + const ussApi = new ZosmfUssApi(loadedProfile); const getSessionMock = jest.spyOn(ussApi, "getSession").mockReturnValue(fakeSession); const putUSSPayload = jest.spyOn(zowe.Utilities, "putUSSPayload").mockResolvedValue(Buffer.from("test")); @@ -174,13 +190,13 @@ describe("ZosmfUssApi", () => { }); it("constants should be unchanged", () => { - const zosmfApi = new ZosmfUssApi(); + const zosmfApi = new ZosmfUssApi(loadedProfile); expect(zosmfApi.getProfileTypeName()).toMatchSnapshot(); expect(zosmfApi.getTokenTypeName()).toMatchSnapshot(); }); it("getSessionFromCommandArgument should build session from arguments", () => { - const zosmfApi = new ZosmfUssApi(); + const zosmfApi = new ZosmfUssApi(loadedProfile); const session = zosmfApi.getSessionFromCommandArgument(fakeProfile as unknown as zowe.imperative.ICommandArguments); expect(session).toBeDefined(); const sessCfg: zowe.imperative.ISession = { @@ -188,6 +204,7 @@ describe("ZosmfUssApi", () => { hostname: fakeProfile.host, type: zowe.imperative.SessConstants.AUTH_TYPE_BASIC, }; + delete sessCfg["responseTimeout"]; delete sessCfg["host"]; expect(session.ISession).toMatchObject(sessCfg); }); @@ -203,6 +220,7 @@ describe("ZosmfUssApi", () => { hostname: fakeProfile.host, type: zowe.imperative.SessConstants.AUTH_TYPE_BASIC, }; + delete sessCfg["responseTimeout"]; delete sessCfg.host; expect(session.ISession).toMatchObject(sessCfg); }); @@ -213,6 +231,7 @@ describe("ZosmfUssApi", () => { tokenType: zowe.imperative.SessConstants.TOKEN_TYPE_JWT, tokenValue: "fakeToken", }; + delete fakeProfileWithToken["responseTimeout"]; delete fakeProfileWithToken.user; delete fakeProfileWithToken.password; const zosmfApi = new ZosmfUssApi({ @@ -238,7 +257,7 @@ describe("ZosmfUssApi", () => { }); it("getStatus should validate active profile", async () => { - const zosmfApi = new ZosmfUssApi(); + const zosmfApi = new ZosmfUssApi(loadedProfile); const checkStatusSpy = jest.spyOn(zowe.CheckStatus, "getZosmfInfo").mockResolvedValue({}); const status = await zosmfApi.getStatus({ profile: fakeProfile } as unknown as zowe.imperative.IProfileLoaded, "zosmf"); expect(status).toBe("active"); @@ -246,7 +265,7 @@ describe("ZosmfUssApi", () => { }); it("getStatus should validate inactive profile", async () => { - const zosmfApi = new ZosmfUssApi(); + const zosmfApi = new ZosmfUssApi(loadedProfile); const checkStatusSpy = jest.spyOn(zowe.CheckStatus, "getZosmfInfo").mockResolvedValue(undefined as unknown as IZosmfInfoResponse); const status = await zosmfApi.getStatus({ profile: fakeProfile } as unknown as zowe.imperative.IProfileLoaded, "zosmf"); expect(status).toBe("inactive"); @@ -254,7 +273,7 @@ describe("ZosmfUssApi", () => { }); it("should test that copy calls zowe.Utilities.putUSSPayload", async () => { - const api = new ZosmfUssApi(); + const api = new ZosmfUssApi(loadedProfile); api.getSession = jest.fn(); const response = Buffer.from("hello world!"); @@ -267,13 +286,13 @@ describe("ZosmfUssApi", () => { }); it("getStatus should validate unverified profile", async () => { - const zosmfApi = new ZosmfUssApi(); + const zosmfApi = new ZosmfUssApi(loadedProfile); const status = await zosmfApi.getStatus({ profile: fakeProfile } as unknown as zowe.imperative.IProfileLoaded, "sample"); expect(status).toBe("unverified"); }); it("login and logout should call APIML endpoints", async () => { - const zosmfApi = new ZosmfUssApi(); + const zosmfApi = new ZosmfUssApi(loadedProfile); const loginSpy = jest.spyOn(zowe.Login, "apimlLogin").mockResolvedValue(""); const logoutSpy = jest.spyOn(zowe.Logout, "apimlLogout").mockResolvedValue(); @@ -285,7 +304,7 @@ describe("ZosmfUssApi", () => { }); it("should retrieve the tag of a file", async () => { - const zosmfApi = new ZosmfUssApi(); + const zosmfApi = new ZosmfUssApi(loadedProfile); jest.spyOn(JSON, "parse").mockReturnValue({ stdout: ["-t UTF-8 tesfile.txt"], }); @@ -298,7 +317,7 @@ describe("ZosmfUssApi", () => { }); it("should update the tag attribute when passed in", async () => { - const zosmfApi = new ZosmfUssApi(); + const zosmfApi = new ZosmfUssApi(loadedProfile); const changeTagSpy = jest.fn(); Object.defineProperty(zowe.Utilities, "putUSSPayload", { value: changeTagSpy, @@ -317,7 +336,7 @@ describe("ZosmfUssApi", () => { { name: "fileList", spy: jest.spyOn(zowe.List, "fileList"), - args: ["ussPath"], + args: ["ussPath", fakeProperties], }, { name: "isFileTagBinOrAscii", @@ -327,39 +346,48 @@ describe("ZosmfUssApi", () => { { name: "getContents", spy: jest.spyOn(zowe.Download, "ussFile"), - args: ["ussPath", {}], + args: ["ussPath", fakeProperties], }, { name: "putContents", spy: jest.spyOn(zowe.Upload, "fileToUssFile"), args: ["localPath", "ussPath"], - transform: (args) => [...args, { binary: undefined, etag: undefined, localEncoding: undefined, returnEtag: undefined }], + transform: (args) => [ + ...args, + { + binary: undefined, + etag: undefined, + localEncoding: undefined, + returnEtag: undefined, + ...fakeProperties, + }, + ], }, { name: "putContent", spy: jest.spyOn(zowe.Upload, "fileToUssFile"), - args: ["localPath", "ussPath", {}], + args: ["localPath", "ussPath", fakeProperties], }, { name: "uploadDirectory", spy: jest.spyOn(zowe.Upload, "dirToUSSDirRecursive"), - args: ["localPath", "ussPath", {}], + args: ["localPath", "ussPath", fakeProperties], }, { name: "create", spy: jest.spyOn(zowe.Create, "uss"), - args: ["ussPath", "file", "777"], + args: ["ussPath", "file", "777", fakeProperties], }, { name: "delete", spy: jest.spyOn(zowe.Delete, "ussFile"), args: ["/ussPath", false], - transform: (args) => [args[0].slice(1), args[1]], + transform: (args) => [args[0].slice(1), args[1], fakeProperties], }, { name: "delete", spy: jest.spyOn(zowe.Delete, "ussFile"), - args: ["ussPath", false], + args: ["ussPath", false, fakeProperties], }, { name: "rename", @@ -369,7 +397,7 @@ describe("ZosmfUssApi", () => { ]; ussApis.forEach((ussApi) => { it(`${ussApi?.name} should inject session into Zowe API`, async () => { - await expectApiWithSession(ussApi, new ZosmfUssApi()); + await expectApiWithSession(ussApi, new ZosmfUssApi(loadedProfile)); }); }); }); @@ -379,38 +407,38 @@ describe("ZosmfMvsApi", () => { { name: "dataSet", spy: jest.spyOn(zowe.List, "dataSet"), - args: ["dsname", {}], + args: ["dsname", fakeProperties], }, { name: "allMembers", spy: jest.spyOn(zowe.List, "allMembers"), - args: ["dsname", {}], + args: ["dsname", fakeProperties], }, { name: "getContents", spy: jest.spyOn(zowe.Download, "dataSet"), - args: ["dsname", {}], + args: ["dsname", fakeProperties], }, { name: "putContents", spy: jest.spyOn(zowe.Upload, "pathToDataSet"), - args: ["localPath", "dsname", {}], + args: ["localPath", "dsname", fakeProperties], }, { name: "createDataSet", spy: jest.spyOn(zowe.Create, "dataSet"), - args: [0, "dsname", {}], + args: [0, "dsname", fakeProperties], }, { name: "createDataSetMember", spy: jest.spyOn(zowe.Upload, "bufferToDataSet"), - args: ["dsname", {}], + args: ["dsname", fakeProperties], transform: (args) => [Buffer.from(""), ...args], }, { name: "allocateLikeDataSet", spy: jest.spyOn(zowe.Create, "dataSetLike"), - args: ["dsname1", "dsname2"], + args: ["dsname1", "dsname2", fakeProperties], }, { name: "copyDataSetMember", @@ -420,13 +448,13 @@ describe("ZosmfMvsApi", () => { { dsn: "dsname2", member: "member2" }, { "from-dataset": { dsn: "dsname1", member: "member1" } }, ], - transform: (args) => [args[1], args[2]], + transform: (args) => [args[1], { ...args[2], ...fakeProperties }], }, { name: "copyDataSetMember", spy: jest.spyOn(zowe.Copy, "dataSet"), args: [{ dsn: "dsname1", member: "member1" }, { dsn: "dsname2", member: "member2" }, {} as any], - transform: (args) => [args[1], { "from-dataset": args[0] }], + transform: (args) => [args[1], { "from-dataset": args[0], ...fakeProperties }], }, { name: "copyDataSetMember", @@ -435,37 +463,37 @@ describe("ZosmfMvsApi", () => { { dsn: "dsname1", member: "member1" }, { dsn: "dsname2", member: "member2" }, ], - transform: (args) => [args[1], { "from-dataset": args[0] }], + transform: (args) => [args[1], { "from-dataset": args[0], ...fakeProperties }], }, { name: "renameDataSet", spy: jest.spyOn(zowe.Rename, "dataSet"), - args: ["dsname1", "dsname2"], + args: ["dsname1", "dsname2", fakeProperties], }, { name: "renameDataSetMember", spy: jest.spyOn(zowe.Rename, "dataSetMember"), - args: ["dsname", "member1", "member2"], + args: ["dsname", "member1", "member2", fakeProperties], }, { name: "hMigrateDataSet", spy: jest.spyOn(zowe.HMigrate, "dataSet"), - args: ["dsname"], + args: ["dsname", fakeProperties], }, { name: "hRecallDataSet", spy: jest.spyOn(zowe.HRecall, "dataSet"), - args: ["dsname"], + args: ["dsname", fakeProperties], }, { name: "deleteDataSet", spy: jest.spyOn(zowe.Delete, "dataSet"), - args: ["dsname", {}], + args: ["dsname", fakeProperties], }, ]; mvsApis.forEach((mvsApi) => { it(`${mvsApi?.name} should inject session into Zowe API`, async () => { - await expectApiWithSession(mvsApi, new ZosmfMvsApi()); + await expectApiWithSession(mvsApi, new ZosmfMvsApi(loadedProfile)); }); }); }); diff --git a/packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts b/packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts index 38cc4b0dc8..925fe12951 100644 --- a/packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts +++ b/packages/zowe-explorer-api/src/profiles/ZoweExplorerZosmfApi.ts @@ -107,7 +107,7 @@ class ZosmfApiCommon implements ZoweExplorerApi.ICommon { */ export class ZosmfUssApi extends ZosmfApiCommon implements ZoweExplorerApi.IUss { public fileList(ussFilePath: string): Promise { - return zowe.List.fileList(this.getSession(), ussFilePath); + return zowe.List.fileList(this.getSession(), ussFilePath, { responseTimeout: this.profile?.profile?.responseTimeout }); } public isFileTagBinOrAscii(ussFilePath: string): Promise { @@ -115,11 +115,14 @@ export class ZosmfUssApi extends ZosmfApiCommon implements ZoweExplorerApi.IUss } public getContents(inputFilePath: string, options: zowe.IDownloadOptions): Promise { - return zowe.Download.ussFile(this.getSession(), inputFilePath, options); + return zowe.Download.ussFile(this.getSession(), inputFilePath, { + responseTimeout: this.profile?.profile?.responseTimeout, + ...options, + }); } public copy(outputPath: string, options?: Omit): Promise { - return zowe.Utilities.putUSSPayload(this.getSession(), outputPath, { ...(options ?? {}), request: "copy" }); + return zowe.Utilities.putUSSPayload(this.getSession(), outputPath, { ...options, request: "copy" }); } /** @@ -138,12 +141,16 @@ export class ZosmfUssApi extends ZosmfApiCommon implements ZoweExplorerApi.IUss binary, localEncoding, etag, + responseTimeout: this.profile?.profile?.responseTimeout, returnEtag, }); } public putContent(inputFilePath: string, ussFilePath: string, options: zowe.IUploadOptions): Promise { - return zowe.Upload.fileToUssFile(this.getSession(), inputFilePath, ussFilePath, options); + return zowe.Upload.fileToUssFile(this.getSession(), inputFilePath, ussFilePath, { + responseTimeout: this.profile?.profile?.responseTimeout, + ...options, + }); } public async updateAttributes(ussPath: string, attributes: Partial): Promise { @@ -192,17 +199,20 @@ export class ZosmfUssApi extends ZosmfApiCommon implements ZoweExplorerApi.IUss } public uploadDirectory(inputDirectoryPath: string, ussDirectoryPath: string, options?: zowe.IUploadOptions): Promise { - return zowe.Upload.dirToUSSDirRecursive(this.getSession(), inputDirectoryPath, ussDirectoryPath, options); + return zowe.Upload.dirToUSSDirRecursive(this.getSession(), inputDirectoryPath, ussDirectoryPath, { + responseTimeout: this.profile?.profile?.responseTimeout, + ...options, + }); } public create(ussPath: string, type: string, mode?: string): Promise { - return zowe.Create.uss(this.getSession(), ussPath, type, mode); + return zowe.Create.uss(this.getSession(), ussPath, type, mode, { responseTimeout: this.profile?.profile?.responseTimeout }); } public delete(ussPath: string, recursive?: boolean): Promise { // handle zosmf api issue with file paths const fixedName = ussPath.startsWith("/") ? ussPath.substring(1) : ussPath; - return zowe.Delete.ussFile(this.getSession(), fixedName, recursive); + return zowe.Delete.ussFile(this.getSession(), fixedName, recursive, { responseTimeout: this.profile?.profile?.responseTimeout }); } public async rename(currentUssPath: string, newUssPath: string): Promise { @@ -228,19 +238,22 @@ export class ZosmfUssApi extends ZosmfApiCommon implements ZoweExplorerApi.IUss */ export class ZosmfMvsApi extends ZosmfApiCommon implements ZoweExplorerApi.IMvs { public dataSet(filter: string, options?: zowe.IListOptions): Promise { - return zowe.List.dataSet(this.getSession(), filter, options); + return zowe.List.dataSet(this.getSession(), filter, { responseTimeout: this.profile?.profile?.responseTimeout, ...options }); } public allMembers(dataSetName: string, options?: zowe.IListOptions): Promise { - return zowe.List.allMembers(this.getSession(), dataSetName, options); + return zowe.List.allMembers(this.getSession(), dataSetName, { responseTimeout: this.profile?.profile?.responseTimeout, ...options }); } public getContents(dataSetName: string, options?: zowe.IDownloadOptions): Promise { - return zowe.Download.dataSet(this.getSession(), dataSetName, options); + return zowe.Download.dataSet(this.getSession(), dataSetName, { responseTimeout: this.profile?.profile?.responseTimeout, ...options }); } public putContents(inputFilePath: string, dataSetName: string, options?: zowe.IUploadOptions): Promise { - return zowe.Upload.pathToDataSet(this.getSession(), inputFilePath, dataSetName, options); + return zowe.Upload.pathToDataSet(this.getSession(), inputFilePath, dataSetName, { + responseTimeout: this.profile?.profile?.responseTimeout, + ...options, + }); } public createDataSet( @@ -248,15 +261,21 @@ export class ZosmfMvsApi extends ZosmfApiCommon implements ZoweExplorerApi.IMvs dataSetName: string, options?: Partial ): Promise { - return zowe.Create.dataSet(this.getSession(), dataSetType, dataSetName, options); + return zowe.Create.dataSet(this.getSession(), dataSetType, dataSetName, { + responseTimeout: this.profile?.profile?.responseTimeout, + ...options, + }); } public createDataSetMember(dataSetName: string, options?: zowe.IUploadOptions): Promise { - return zowe.Upload.bufferToDataSet(this.getSession(), Buffer.from(""), dataSetName, options); + return zowe.Upload.bufferToDataSet(this.getSession(), Buffer.from(""), dataSetName, { + responseTimeout: this.profile?.profile?.responseTimeout, + ...options, + }); } public allocateLikeDataSet(dataSetName: string, likeDataSetName: string): Promise { - return zowe.Create.dataSetLike(this.getSession(), dataSetName, likeDataSetName); + return zowe.Create.dataSetLike(this.getSession(), dataSetName, likeDataSetName, { responseTimeout: this.profile?.profile?.responseTimeout }); } public copyDataSetMember( @@ -278,34 +297,46 @@ export class ZosmfMvsApi extends ZosmfApiCommon implements ZoweExplorerApi.IMvs // If we decide to match 1:1 the Zowe.Copy.dataSet implementation, we will need to break the interface definition in the ZoweExplorerApi newOptions = { "from-dataset": { dsn: fromDataSetName, member: fromMemberName } }; } - return zowe.Copy.dataSet(this.getSession(), { dsn: toDataSetName, member: toMemberName }, newOptions); + return zowe.Copy.dataSet( + this.getSession(), + { dsn: toDataSetName, member: toMemberName }, + { responseTimeout: this.profile?.profile?.responseTimeout, ...newOptions } + ); } public renameDataSet(currentDataSetName: string, newDataSetName: string): Promise { - return zowe.Rename.dataSet(this.getSession(), currentDataSetName, newDataSetName); + return zowe.Rename.dataSet(this.getSession(), currentDataSetName, newDataSetName, { + responseTimeout: this.profile?.profile?.responseTimeout, + }); } public renameDataSetMember(dataSetName: string, oldMemberName: string, newMemberName: string): Promise { - return zowe.Rename.dataSetMember(this.getSession(), dataSetName, oldMemberName, newMemberName); + return zowe.Rename.dataSetMember(this.getSession(), dataSetName, oldMemberName, newMemberName, { + responseTimeout: this.profile?.profile?.responseTimeout, + }); } public hMigrateDataSet(dataSetName: string): Promise { - return zowe.HMigrate.dataSet(this.getSession(), dataSetName); + return zowe.HMigrate.dataSet(this.getSession(), dataSetName, { responseTimeout: this.profile?.profile?.responseTimeout }); } public hRecallDataSet(dataSetName: string): Promise { - return zowe.HRecall.dataSet(this.getSession(), dataSetName); + return zowe.HRecall.dataSet(this.getSession(), dataSetName, { responseTimeout: this.profile?.profile?.responseTimeout }); } public deleteDataSet(dataSetName: string, options?: zowe.IDeleteDatasetOptions): Promise { - return zowe.Delete.dataSet(this.getSession(), dataSetName, options); + return zowe.Delete.dataSet(this.getSession(), dataSetName, { responseTimeout: this.profile?.profile?.responseTimeout, ...options }); } public dataSetsMatchingPattern(filter: string[], options?: zowe.IDsmListOptions): Promise { - return zowe.List.dataSetsMatchingPattern(this.getSession(), filter, options); + return zowe.List.dataSetsMatchingPattern(this.getSession(), filter, { responseTimeout: this.profile?.profile?.responseTimeout, ...options }); } public copyDataSet(fromDataSetName: string, toDataSetName: string, enq?: string, replace?: boolean): Promise { - return zowe.Copy.dataSet(this.getSession(), { dsn: toDataSetName }, { "from-dataset": { dsn: fromDataSetName }, enq, replace }); + return zowe.Copy.dataSet( + this.getSession(), + { dsn: toDataSetName }, + { "from-dataset": { dsn: fromDataSetName }, enq, replace, responseTimeout: this.profile?.profile?.responseTimeout } + ); } } diff --git a/packages/zowe-explorer/__tests__/__unit__/api/ZoweExplorerZosmfApi.unit.test.ts b/packages/zowe-explorer/__tests__/__unit__/api/ZoweExplorerZosmfApi.unit.test.ts index e00d8e955f..fae545f05c 100644 --- a/packages/zowe-explorer/__tests__/__unit__/api/ZoweExplorerZosmfApi.unit.test.ts +++ b/packages/zowe-explorer/__tests__/__unit__/api/ZoweExplorerZosmfApi.unit.test.ts @@ -30,7 +30,9 @@ describe("Zosmf API tests", () => { const api = new ZosmfMvsApi(); api.getSession = jest.fn(); - await api.copyDataSetMember({ dsn: "IBM.FROM", member: "IEFBR14" }, { dsn: "IBM.TO", member: "IEFBR15" }); + await api.copyDataSetMember({ dsn: "IBM.FROM", member: "IEFBR14" }, { dsn: "IBM.TO", member: "IEFBR15" }, { + responseTimeout: undefined, + } as any); }); it("should test that copy data set uses enq", async () => { @@ -46,7 +48,7 @@ describe("Zosmf API tests", () => { await api.copyDataSetMember( { dsn: "IBM.FROM", member: "IEFBR14" }, { dsn: "IBM.TO", member: "IEFBR15" }, - { enq: "SHR", "from-dataset": { dsn: "BROADCOM.FROM" } } + { enq: "SHR", "from-dataset": { dsn: "BROADCOM.FROM" }, responseTimeout: undefined } ); }); @@ -62,6 +64,7 @@ describe("Zosmf API tests", () => { api.getSession = jest.fn(); await api.copyDataSetMember({ dsn: "IBM.FROM", member: "IEFBR14" }, { dsn: "IBM.TO", member: "IEFBR15" }, { enq: "SHR", + responseTimeout: undefined, } as any); }); @@ -100,6 +103,7 @@ describe("Zosmf API tests", () => { await api.putContent("someLocalFile.txt", "/some/remote", { encoding: "285", + responseTimeout: undefined, }); }); diff --git a/packages/zowe-explorer/__tests__/__unit__/api/__snapshots__/ZoweExplorerZosmfApi.unit.test.ts.snap b/packages/zowe-explorer/__tests__/__unit__/api/__snapshots__/ZoweExplorerZosmfApi.unit.test.ts.snap index c3eed47e87..b8a072080a 100644 --- a/packages/zowe-explorer/__tests__/__unit__/api/__snapshots__/ZoweExplorerZosmfApi.unit.test.ts.snap +++ b/packages/zowe-explorer/__tests__/__unit__/api/__snapshots__/ZoweExplorerZosmfApi.unit.test.ts.snap @@ -3,6 +3,7 @@ exports[`Zosmf API tests should test putContent method passes all options to Zowe api method 1`] = ` { "encoding": "285", + "responseTimeout": undefined, } `; @@ -12,6 +13,7 @@ exports[`Zosmf API tests should test that copy data set uses default options 1`] "dsn": "IBM.FROM", "member": "IEFBR14", }, + "responseTimeout": undefined, } `; @@ -21,6 +23,7 @@ exports[`Zosmf API tests should test that copy data set uses enq 1`] = ` "from-dataset": { "dsn": "BROADCOM.FROM", }, + "responseTimeout": undefined, } `; @@ -31,5 +34,6 @@ exports[`Zosmf API tests should test that copy data set uses enq only 1`] = ` "dsn": "IBM.FROM", "member": "IEFBR14", }, + "responseTimeout": undefined, } `;