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