@nsshunt/ststestrunner 1.1.70 → 1.1.72

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.
@@ -154,41 +154,29 @@ var TestCaseFhirBase = class {
154
154
  GetFhirSocketClient = async () => {
155
155
  try {
156
156
  this.#clientSocketFetchCount++;
157
- const optionszz = this.runnerExecutionWorker.Options;
158
- if (optionszz) {
159
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
160
- console.log(`optionszz`);
161
- console.log(optionszz);
162
- console.log(this.runnerExecutionWorker.id);
163
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
164
- } else {
165
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
166
- console.log(`no optionszz`);
167
- console.log(this.runnerExecutionWorker.id);
168
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
169
- }
170
157
  let fhirClient = this.runnerExecutionWorker.GetFhirClient();
171
- if (fhirClient) {
172
- console.log(chalk.default.green(`[${this.runnerExecutionWorker.id}] Getting existing fhir client`));
173
- return fhirClient;
174
- }
158
+ if (fhirClient) return fhirClient;
175
159
  if (this.runnerExecutionWorker.GetOnHold("fhirclient") === true) {
176
- console.log(chalk.default.magenta(`[${this.runnerExecutionWorker.id}] fhir client does not exist - some other client setting up the new client - waiting ...`));
160
+ this.Debug(chalk.default.magenta(`[${this.runnerExecutionWorker.id}] fhir client does not exist - some other client setting up the new client (on hold/lock) - waiting ...`));
177
161
  try {
162
+ const start = performance.now();
178
163
  await this.runnerExecutionWorker.WaitOnHold("fhirclient", 6e4);
164
+ this.Debug(chalk.default.yellow(`[${this.runnerExecutionWorker.id}] hold (lock) released after: [${performance.now() - start}ms]`));
179
165
  const fhirClient = this.runnerExecutionWorker.GetFhirClient();
180
166
  if (fhirClient) {
181
- console.log(chalk.default.green(`[${this.runnerExecutionWorker.id}] Getting existing fhir client (post hold release)`));
167
+ this.Debug(chalk.default.green(`[${this.runnerExecutionWorker.id}] Getting existing fhir client (post hold release)`));
182
168
  return fhirClient;
183
169
  } else {
184
- console.log(chalk.default.red(`[${this.runnerExecutionWorker.id}] Could not get existing fhir client (post hold release)`));
185
- console.log(chalk.default.red(`continue anyway ...`));
170
+ this.Error(chalk.default.red(`[${this.runnerExecutionWorker.id}] Could not get existing fhir client (post hold release)`));
171
+ this.Error(chalk.default.red(`continue anyway ...`));
186
172
  }
187
173
  } catch (error) {
188
- console.error(chalk.default.red(`GetFhirSocketClient(): Error: [${error}]`));
174
+ this.Error(chalk.default.red(`GetFhirSocketClient(): Error: [${error}]`));
189
175
  }
190
176
  }
191
- console.log(chalk.default.red(`[${this.runnerExecutionWorker.id}] fhir client does not exist - setting up new client`));
177
+ const start = performance.now();
178
+ this.Debug(chalk.default.yellow(`[${this.runnerExecutionWorker.id}] fhir client does not exist - setting up new client`));
179
+ this.Debug(chalk.default.yellow(`[${this.runnerExecutionWorker.id}] setting hold (lock)`));
192
180
  this.runnerExecutionWorker.SetOnHold("fhirclient");
193
181
  const fhirOptions = this.#options.fhirOptions;
194
182
  const options = {
@@ -209,9 +197,10 @@ var TestCaseFhirBase = class {
209
197
  if (this.runner.options.fhirOptions.stsfhirsocketclientmode === "socket-client-all-in-one") fhirClient = new _nsshunt_stsfhirclient.FhirSocketClientAllInOne("FhirSocketClient", options);
210
198
  else fhirClient = new _nsshunt_stsfhirclient.FhirSocketClientIndividual("FhirSocketClient", options);
211
199
  await fhirClient.WaitForSocketConnected();
212
- console.log(chalk.default.red(`[${this.runnerExecutionWorker.id}] setting fhir client into object`));
200
+ this.Debug(chalk.default.yellow(`[${this.runnerExecutionWorker.id}] setting fhir client into object`));
213
201
  this.runnerExecutionWorker.SetFhirClient(fhirClient);
214
202
  this.runnerExecutionWorker.ReleaseOnHold("fhirclient");
203
+ this.Debug(chalk.default.yellow(`[${this.runnerExecutionWorker.id}] release hold (lock) Time taken for socket connection and set object: [${performance.now() - start}ms]`));
215
204
  return fhirClient;
216
205
  } catch (error) {
217
206
  this.LogErrorMessage(error);