@nsshunt/ststestrunner 1.1.25 → 1.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,7 +34,6 @@ let _nsshunt_stsrunnerframework = require("@nsshunt/stsrunnerframework");
34
34
  let _nsshunt_stsutils = require("@nsshunt/stsutils");
35
35
  let chalk = require("chalk");
36
36
  chalk = __toESM(chalk, 1);
37
- let _nsshunt_stsauthclient = require("@nsshunt/stsauthclient");
38
37
  let _nsshunt_stsfhirclient = require("@nsshunt/stsfhirclient");
39
38
  let node_http = require("node:http");
40
39
  node_http = __toESM(node_http, 1);
@@ -58,37 +57,37 @@ var TestCaseFhirBase = class {
58
57
  newTokenLimitTime = 30;
59
58
  fhirClient = null;
60
59
  restFhirClient = null;
61
- agentManagerZZ;
62
- authUtilsNode;
60
+ agentManagerAuthentication;
61
+ defaultAgentOptions = {
62
+ keepAlive: true,
63
+ maxSockets: 10,
64
+ maxTotalSockets: 20,
65
+ maxFreeSockets: 10,
66
+ timeout: 6e4,
67
+ rejectUnauthorized: false
68
+ };
69
+ stressTestAgentOptions = {
70
+ keepAlive: true,
71
+ maxSockets: 200,
72
+ maxTotalSockets: 500,
73
+ maxFreeSockets: 50,
74
+ timeout: 3e4,
75
+ rejectUnauthorized: false
76
+ };
77
+ stressTestExtremeAgentOptions = {
78
+ keepAlive: true,
79
+ maxSockets: 500,
80
+ maxTotalSockets: 1e3,
81
+ maxFreeSockets: 500,
82
+ timeout: 3e4,
83
+ rejectUnauthorized: false
84
+ };
63
85
  constructor(runnerExecutionWorker, runner) {
64
86
  this.#options = runner.options;
65
87
  this.#runnerExecutionWorker = runnerExecutionWorker;
66
88
  this.#runner = runner;
67
- this.agentManagerZZ = (0, _nsshunt_stsutils.createAgentManager)({
68
- agentOptions: {
69
- keepAlive: true,
70
- maxFreeSockets: 10,
71
- maxSockets: 10,
72
- maxTotalSockets: 20,
73
- timeout: 6e4,
74
- rejectUnauthorized: false
75
- },
76
- httpAgentFactory(options) {
77
- return new node_http.default.Agent(options);
78
- },
79
- httpsAgentFactory(options) {
80
- return new node_https.default.Agent(options);
81
- }
82
- });
83
- const agentManager = (0, _nsshunt_stsutils.createAgentManager)({
84
- agentOptions: {
85
- keepAlive: true,
86
- maxFreeSockets: 10,
87
- maxSockets: 10,
88
- maxTotalSockets: 20,
89
- timeout: 6e4,
90
- rejectUnauthorized: false
91
- },
89
+ this.agentManagerAuthentication = (0, _nsshunt_stsutils.createAgentManager)({
90
+ agentOptions: this.stressTestAgentOptions,
92
91
  httpAgentFactory(options) {
93
92
  return new node_http.default.Agent(options);
94
93
  },
@@ -96,10 +95,6 @@ var TestCaseFhirBase = class {
96
95
  return new node_https.default.Agent(options);
97
96
  }
98
97
  });
99
- this.authUtilsNode = new _nsshunt_stsauthclient.AuthUtilsNode({
100
- logger: _nsshunt_stsutils.defaultLogger,
101
- agentManager
102
- });
103
98
  }
104
99
  get runnerExecutionWorker() {
105
100
  return this.#runnerExecutionWorker;
@@ -108,14 +103,7 @@ var TestCaseFhirBase = class {
108
103
  GetRESTClient = async () => {
109
104
  if (this.restFhirClient) return this.restFhirClient;
110
105
  const agentManager = (0, _nsshunt_stsutils.createAgentManager)({
111
- agentOptions: {
112
- keepAlive: true,
113
- maxFreeSockets: 10,
114
- maxSockets: 10,
115
- maxTotalSockets: 20,
116
- timeout: 6e4,
117
- rejectUnauthorized: false
118
- },
106
+ agentOptions: this.stressTestAgentOptions,
119
107
  httpAgentFactory(options) {
120
108
  return new node_http.default.Agent(options);
121
109
  },
@@ -147,14 +135,7 @@ var TestCaseFhirBase = class {
147
135
  try {
148
136
  if (this.fhirClient) return this.fhirClient;
149
137
  const agentManager = (0, _nsshunt_stsutils.createAgentManager)({
150
- agentOptions: {
151
- keepAlive: true,
152
- maxFreeSockets: 10,
153
- maxSockets: 10,
154
- maxTotalSockets: 20,
155
- timeout: 6e4,
156
- rejectUnauthorized: false
157
- },
138
+ agentOptions: this.stressTestAgentOptions,
158
139
  httpAgentFactory(options) {
159
140
  return new node_http.default.Agent(options);
160
141
  },
@@ -279,7 +260,7 @@ var TestCaseFhirBase = class {
279
260
  stage = "6";
280
261
  const url = endPoint ? `${endPoint}${this.#options.authOptions.asoauthapiroot}/token` : `${this.#options.authOptions.asendpoint}:${this.#options.authOptions.asport}${this.#options.authOptions.asoauthapiroot}/token`;
281
262
  stage = `6.5: url: [${url}] payload: [${JSON.stringify(payload)}]`;
282
- const axiosConfig = new _nsshunt_stsutils.STSAxiosConfig(url, "post").withDefaultHeaders().withData(payload).withAgentManager(this.agentManagerZZ);
263
+ const axiosConfig = new _nsshunt_stsutils.STSAxiosConfig(url, "post").withDefaultHeaders().withData(payload).withAgentManager(this.agentManagerAuthentication);
283
264
  const retVal = await (0, _nsshunt_stsfhirclient.createRetryAxiosClient)({
284
265
  maxRetries: 4,
285
266
  retryDelayMs: 300,