@nsshunt/ststestrunner 1.1.93 → 1.1.95

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.
@@ -767,6 +767,11 @@ var TestCaseFhirBase = class {
767
767
  return true;
768
768
  }
769
769
  } else this.Error(chalk.default.red(`TestCaseFhirBase:HandleError(): AXIOS Error = [${axiosError}]`));
770
+ } else if (error.message === "UNAUTHORIZED") {
771
+ this.runner.instrumentData.authenticationErrorCount++;
772
+ this.Error(chalk.default.red(`TestCaseFhirBase:HandleError(): UNAUTHORIZED - Reset Access Token`));
773
+ this.ResetAccessToken();
774
+ return true;
770
775
  }
771
776
  return false;
772
777
  };
@@ -948,6 +953,14 @@ var TestCaseFhirBase = class {
948
953
  this.retryCount = 0;
949
954
  return this._ExecuteQuery();
950
955
  };
956
+ _RetryMap = [
957
+ 100,
958
+ 250,
959
+ 500,
960
+ 1e3,
961
+ 2e3,
962
+ 3e3
963
+ ];
951
964
  _ExecuteQuery = async () => {
952
965
  try {
953
966
  return await this.PerformExecuteQuery();
@@ -958,7 +971,8 @@ var TestCaseFhirBase = class {
958
971
  this.runner.instrumentData.authenticationRetryCount++;
959
972
  const message = `TestCaseFhir02:ExecuteQuery(): Retry auth attempt: retryCount: [${this.retryCount}], maxAuthRetryCount: [${this.maxAuthRetryCount}]`;
960
973
  this.Error(message);
961
- await (0, _nsshunt_stsutils.Sleep)(this.retryCount * 1e3);
974
+ if (this.retryCount > this._RetryMap.length) await (0, _nsshunt_stsutils.Sleep)(this._RetryMap[this._RetryMap.length - 1]);
975
+ else await (0, _nsshunt_stsutils.Sleep)(this._RetryMap[this.retryCount - 1]);
962
976
  return await this._ExecuteQuery();
963
977
  } else {
964
978
  const message = `TestCaseFhir02:ExecuteQuery(): Max auth retries exceeded: retryCount: [${this.retryCount}], maxAuthRetryCount: [${this.maxAuthRetryCount}], Error: [${error}]`;
@@ -1068,6 +1082,7 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
1068
1082
  const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1069
1083
  const retVal = await client.PostResource("Person", personRecord);
1070
1084
  this._CheckOutputLongDurationError(__snapshot3, "await this.PostResource()");
1085
+ if (retVal.status === StatusCodes.UNAUTHORIZED) throw new Error("UNAUTHORIZED");
1071
1086
  delete personRecord.meta;
1072
1087
  delete retVal.body.meta;
1073
1088
  const p1 = JSON.stringify(personRecord);