@nsshunt/ststestrunner 1.1.158 → 1.1.159

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.
@@ -999,14 +999,22 @@ var TestCaseFhirBase = class {
999
999
  get runnerExecutionWorker() {
1000
1000
  return this.#runnerExecutionWorker;
1001
1001
  }
1002
+ GetMaxIteration(key) {
1003
+ return this.runnerExecutionWorker.GetMaxIteration(key);
1004
+ }
1005
+ SetMaxIteration(key, maxIteration) {
1006
+ this.runnerExecutionWorker.SetMaxIteration(key, maxIteration);
1007
+ }
1002
1008
  ResetClient = () => {};
1003
1009
  GetRandomSequenceFromIteration = () => {
1010
+ const prefix = this.runner.options.personPrefix;
1011
+ const maxIterations = this.GetMaxIteration(prefix);
1004
1012
  if (this.runner.iteration === 0) {
1005
- const { workerIndex, runnerIndex } = this.#runner.options;
1006
- const seedId = `seed-${workerIndex}-${runnerIndex}`;
1007
- this.randomSequence = getRandomIterationOrder(this.runner.options.executionProfile.iterations, seedId);
1013
+ const seedId = prefix;
1014
+ this.randomSequence = getRandomIterationOrder(maxIterations, seedId);
1008
1015
  }
1009
- return this.randomSequence[this.runner.iteration];
1016
+ const useIteration = this.runner.iteration % maxIterations;
1017
+ return this.randomSequence[useIteration];
1010
1018
  };
1011
1019
  Error = (message) => {
1012
1020
  this.#runnerExecutionWorker.logger.error(message);
@@ -1466,6 +1474,7 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
1466
1474
  "entry": []
1467
1475
  };
1468
1476
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "1");
1477
+ this.SetMaxIteration(prefix, this.runner.iteration);
1469
1478
  const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1470
1479
  const foundIndexPersonRecords = this.personRecords.findIndex((p) => p.id?.localeCompare(personRecord.id) === 0);
1471
1480
  const foundIndexBindlePersonRecords = this.bundleBatch.entry.findIndex((p) => p.resource.id?.localeCompare(personRecord.id) === 0);
@@ -1511,7 +1520,8 @@ var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
1511
1520
  const __snapshot1 = performance.now();
1512
1521
  const client = await this.GetClient();
1513
1522
  const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1514
- const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.GetRandomSequenceFromIteration(), "1");
1523
+ const prefix = this.runner.options.personPrefix;
1524
+ const personRecord = await this.GetPersonRecord(prefix, this.GetRandomSequenceFromIteration(), "1");
1515
1525
  const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1516
1526
  const retVal = await client.GetResource("Person", personRecord.id);
1517
1527
  this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
@@ -16850,6 +16860,7 @@ var WorkerFhirTestCases = class extends AbstractRunnerExecutionWorker {
16850
16860
  _id = crypto.randomUUID();
16851
16861
  _clientHelper;
16852
16862
  _authHelper;
16863
+ _maxIteration = {};
16853
16864
  restFhirClient = null;
16854
16865
  logPrefix = `WorkerFhirTestCases:[${this._id}]:`;
16855
16866
  constructor(options) {
@@ -16964,6 +16975,12 @@ var WorkerFhirTestCases = class extends AbstractRunnerExecutionWorker {
16964
16975
  GetClient = async () => {
16965
16976
  return this._clientHelper.GetClient();
16966
16977
  };
16978
+ GetMaxIteration(key) {
16979
+ return this._maxIteration[key];
16980
+ }
16981
+ SetMaxIteration(key, maxIteration) {
16982
+ this._maxIteration[key] = maxIteration;
16983
+ }
16967
16984
  };
16968
16985
  //#endregion
16969
16986
  export { WorkerFhirTestCases };