@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.
@@ -1004,14 +1004,22 @@ var TestCaseFhirBase = class {
1004
1004
  get runnerExecutionWorker() {
1005
1005
  return this.#runnerExecutionWorker;
1006
1006
  }
1007
+ GetMaxIteration(key) {
1008
+ return this.runnerExecutionWorker.GetMaxIteration(key);
1009
+ }
1010
+ SetMaxIteration(key, maxIteration) {
1011
+ this.runnerExecutionWorker.SetMaxIteration(key, maxIteration);
1012
+ }
1007
1013
  ResetClient = () => {};
1008
1014
  GetRandomSequenceFromIteration = () => {
1015
+ const prefix = this.runner.options.personPrefix;
1016
+ const maxIterations = this.GetMaxIteration(prefix);
1009
1017
  if (this.runner.iteration === 0) {
1010
- const { workerIndex, runnerIndex } = this.#runner.options;
1011
- const seedId = `seed-${workerIndex}-${runnerIndex}`;
1012
- this.randomSequence = getRandomIterationOrder(this.runner.options.executionProfile.iterations, seedId);
1018
+ const seedId = prefix;
1019
+ this.randomSequence = getRandomIterationOrder(maxIterations, seedId);
1013
1020
  }
1014
- return this.randomSequence[this.runner.iteration];
1021
+ const useIteration = this.runner.iteration % maxIterations;
1022
+ return this.randomSequence[useIteration];
1015
1023
  };
1016
1024
  Error = (message) => {
1017
1025
  this.#runnerExecutionWorker.logger.error(message);
@@ -1471,6 +1479,7 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
1471
1479
  "entry": []
1472
1480
  };
1473
1481
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "1");
1482
+ this.SetMaxIteration(prefix, this.runner.iteration);
1474
1483
  const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1475
1484
  const foundIndexPersonRecords = this.personRecords.findIndex((p) => p.id?.localeCompare(personRecord.id) === 0);
1476
1485
  const foundIndexBindlePersonRecords = this.bundleBatch.entry.findIndex((p) => p.resource.id?.localeCompare(personRecord.id) === 0);
@@ -1516,7 +1525,8 @@ var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
1516
1525
  const __snapshot1 = performance.now();
1517
1526
  const client = await this.GetClient();
1518
1527
  const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1519
- const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.GetRandomSequenceFromIteration(), "1");
1528
+ const prefix = this.runner.options.personPrefix;
1529
+ const personRecord = await this.GetPersonRecord(prefix, this.GetRandomSequenceFromIteration(), "1");
1520
1530
  const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1521
1531
  const retVal = await client.GetResource("Person", personRecord.id);
1522
1532
  this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
@@ -16855,6 +16865,7 @@ var WorkerFhirTestCases = class extends _nsshunt_stsrunnerframework.AbstractRunn
16855
16865
  _id = crypto.randomUUID();
16856
16866
  _clientHelper;
16857
16867
  _authHelper;
16868
+ _maxIteration = {};
16858
16869
  restFhirClient = null;
16859
16870
  logPrefix = `WorkerFhirTestCases:[${this._id}]:`;
16860
16871
  constructor(options) {
@@ -16969,6 +16980,12 @@ var WorkerFhirTestCases = class extends _nsshunt_stsrunnerframework.AbstractRunn
16969
16980
  GetClient = async () => {
16970
16981
  return this._clientHelper.GetClient();
16971
16982
  };
16983
+ GetMaxIteration(key) {
16984
+ return this._maxIteration[key];
16985
+ }
16986
+ SetMaxIteration(key, maxIteration) {
16987
+ this._maxIteration[key] = maxIteration;
16988
+ }
16972
16989
  };
16973
16990
  //#endregion
16974
16991
  exports.WorkerFhirTestCases = WorkerFhirTestCases;