@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.
@@ -131,41 +131,29 @@ var TestCaseFhirBase = class {
131
131
  GetFhirSocketClient = async () => {
132
132
  try {
133
133
  this.#clientSocketFetchCount++;
134
- const optionszz = this.runnerExecutionWorker.Options;
135
- if (optionszz) {
136
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
137
- console.log(`optionszz`);
138
- console.log(optionszz);
139
- console.log(this.runnerExecutionWorker.id);
140
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
141
- } else {
142
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
143
- console.log(`no optionszz`);
144
- console.log(this.runnerExecutionWorker.id);
145
- console.log(`-----------------------------------------------------------------------------------------------------------------`);
146
- }
147
134
  let fhirClient = this.runnerExecutionWorker.GetFhirClient();
148
- if (fhirClient) {
149
- console.log(chalk.green(`[${this.runnerExecutionWorker.id}] Getting existing fhir client`));
150
- return fhirClient;
151
- }
135
+ if (fhirClient) return fhirClient;
152
136
  if (this.runnerExecutionWorker.GetOnHold("fhirclient") === true) {
153
- console.log(chalk.magenta(`[${this.runnerExecutionWorker.id}] fhir client does not exist - some other client setting up the new client - waiting ...`));
137
+ this.Debug(chalk.magenta(`[${this.runnerExecutionWorker.id}] fhir client does not exist - some other client setting up the new client (on hold/lock) - waiting ...`));
154
138
  try {
139
+ const start = performance.now();
155
140
  await this.runnerExecutionWorker.WaitOnHold("fhirclient", 6e4);
141
+ this.Debug(chalk.yellow(`[${this.runnerExecutionWorker.id}] hold (lock) released after: [${performance.now() - start}ms]`));
156
142
  const fhirClient = this.runnerExecutionWorker.GetFhirClient();
157
143
  if (fhirClient) {
158
- console.log(chalk.green(`[${this.runnerExecutionWorker.id}] Getting existing fhir client (post hold release)`));
144
+ this.Debug(chalk.green(`[${this.runnerExecutionWorker.id}] Getting existing fhir client (post hold release)`));
159
145
  return fhirClient;
160
146
  } else {
161
- console.log(chalk.red(`[${this.runnerExecutionWorker.id}] Could not get existing fhir client (post hold release)`));
162
- console.log(chalk.red(`continue anyway ...`));
147
+ this.Error(chalk.red(`[${this.runnerExecutionWorker.id}] Could not get existing fhir client (post hold release)`));
148
+ this.Error(chalk.red(`continue anyway ...`));
163
149
  }
164
150
  } catch (error) {
165
- console.error(chalk.red(`GetFhirSocketClient(): Error: [${error}]`));
151
+ this.Error(chalk.red(`GetFhirSocketClient(): Error: [${error}]`));
166
152
  }
167
153
  }
168
- console.log(chalk.red(`[${this.runnerExecutionWorker.id}] fhir client does not exist - setting up new client`));
154
+ const start = performance.now();
155
+ this.Debug(chalk.yellow(`[${this.runnerExecutionWorker.id}] fhir client does not exist - setting up new client`));
156
+ this.Debug(chalk.yellow(`[${this.runnerExecutionWorker.id}] setting hold (lock)`));
169
157
  this.runnerExecutionWorker.SetOnHold("fhirclient");
170
158
  const fhirOptions = this.#options.fhirOptions;
171
159
  const options = {
@@ -186,9 +174,10 @@ var TestCaseFhirBase = class {
186
174
  if (this.runner.options.fhirOptions.stsfhirsocketclientmode === "socket-client-all-in-one") fhirClient = new FhirSocketClientAllInOne("FhirSocketClient", options);
187
175
  else fhirClient = new FhirSocketClientIndividual("FhirSocketClient", options);
188
176
  await fhirClient.WaitForSocketConnected();
189
- console.log(chalk.red(`[${this.runnerExecutionWorker.id}] setting fhir client into object`));
177
+ this.Debug(chalk.yellow(`[${this.runnerExecutionWorker.id}] setting fhir client into object`));
190
178
  this.runnerExecutionWorker.SetFhirClient(fhirClient);
191
179
  this.runnerExecutionWorker.ReleaseOnHold("fhirclient");
180
+ this.Debug(chalk.yellow(`[${this.runnerExecutionWorker.id}] release hold (lock) Time taken for socket connection and set object: [${performance.now() - start}ms]`));
192
181
  return fhirClient;
193
182
  } catch (error) {
194
183
  this.LogErrorMessage(error);