@nsshunt/ststestrunner 1.1.78 → 1.1.79

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.
@@ -546,6 +546,15 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
546
546
  _GetDetail = () => {
547
547
  return `testType: [${this.runner.options.testType}], description: [${this.runner.options.description}], workerManagerId: [${this.runner.workerManagerId}], Iteration: [${this.runner.iteration}]`;
548
548
  };
549
+ _CheckOutputLongDurationError = (snapshotStart, message) => {
550
+ const snapShotEnd = performance.now();
551
+ if (snapShotEnd - snapshotStart > 1e3) {
552
+ this.Error(chalk.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): *** ==> Long execution: [${snapShotEnd - snapshotStart}] message: [${message}]`));
553
+ this.Error(chalk.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): ==> ${this._GetDetail()}`));
554
+ this.Error(chalk.red(`TestCaseFhirQueryBase:ExecuteRunner:_OutputLongDurationError(): ==> Note: While not specifically an error, this is logged as an error.`));
555
+ }
556
+ return snapShotEnd;
557
+ };
549
558
  ExecuteRunner = async () => {
550
559
  if (this.runner.iteration % 100 === 0) this.Debug(`TestCaseFhirQueryBase:ExecuteRunner(): ${this._GetDetail()}`);
551
560
  const start = performance.now();
@@ -606,7 +615,9 @@ var TestCaseFhirQueryBase = class extends TestCaseFhirBase {
606
615
  var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
607
616
  ExecuteQuery = async () => {
608
617
  try {
618
+ const __snapshot1 = performance.now();
609
619
  await this.GetAccessToken();
620
+ this._CheckOutputLongDurationError(__snapshot1, "await this.GetAccessToken()");
610
621
  this.accesssToken = null;
611
622
  return null;
612
623
  } catch (error) {
@@ -621,10 +632,15 @@ var TestCaseFhir01 = class extends TestCaseFhirQueryBase {
621
632
  var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
622
633
  ExecuteQuery = async () => {
623
634
  try {
635
+ const __snapshot1 = performance.now();
624
636
  const client = await this.GetClient();
637
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
625
638
  const prefix = this.runner.options.personPrefix;
626
639
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "1");
627
- return (await client.PostResource("Person", personRecord)).body;
640
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
641
+ const retVal = await client.PostResource("Person", personRecord);
642
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PostResource()");
643
+ return retVal.body;
628
644
  } catch (error) {
629
645
  this.runner.instrumentData.errorCount++;
630
646
  this.Error(`TestCaseFhir02:ExecuteQuery(): Error: [${error}]`);
@@ -637,9 +653,13 @@ var TestCaseFhir02 = class extends TestCaseFhirQueryBase {
637
653
  var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
638
654
  ExecuteQuery = async () => {
639
655
  try {
656
+ const __snapshot1 = performance.now();
640
657
  const client = await this.GetClient();
658
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
641
659
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
660
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
642
661
  const retVal = await client.GetResource("Person", personRecord.id);
662
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
643
663
  delete personRecord.meta;
644
664
  delete retVal.body.meta;
645
665
  const p1 = JSON.stringify(personRecord);
@@ -658,9 +678,13 @@ var TestCaseFhir03 = class extends TestCaseFhirQueryBase {
658
678
  var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
659
679
  ExecuteQuery = async () => {
660
680
  try {
681
+ const __snapshot1 = performance.now();
661
682
  const client = await this.GetClient();
683
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
662
684
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
685
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
663
686
  const retVal = await client.GetResource("Person", personRecord.id);
687
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
664
688
  this.runner.instrumentData.requestCount++;
665
689
  const compPersonRecord = { ...personRecord };
666
690
  const loadedPersonRecorded = { ...retVal.body };
@@ -676,6 +700,7 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
676
700
  if (originalPersonRecord && originalPersonRecord.text) {
677
701
  originalPersonRecord.text.div = `Put record TestCaseFhir04 ${this.runner.iteration}`;
678
702
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"1"`);
703
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PutResource()");
679
704
  const updatedRecord = { ...retVal.body };
680
705
  delete updatedRecord.meta;
681
706
  delete originalPersonRecord.meta;
@@ -699,11 +724,15 @@ var TestCaseFhir04 = class extends TestCaseFhirQueryBase {
699
724
  var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
700
725
  ExecuteQuery = async () => {
701
726
  try {
727
+ const __snapshot1 = performance.now();
702
728
  const client = await this.GetClient();
729
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
703
730
  const originalPersonRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "2");
731
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
704
732
  if (originalPersonRecord && originalPersonRecord.text) {
705
733
  originalPersonRecord.text.div = `Put record TestCaseFhir05 ${this.runner.iteration}`;
706
734
  const retVal = await client.PutResource("Person", originalPersonRecord, `W/"2"`);
735
+ this._CheckOutputLongDurationError(__snapshot3, "await this.PutResource()");
707
736
  const updatedRecord = { ...retVal.body };
708
737
  delete updatedRecord.meta;
709
738
  delete originalPersonRecord.meta;
@@ -727,11 +756,13 @@ var TestCaseFhir05 = class extends TestCaseFhirQueryBase {
727
756
  var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
728
757
  ExecuteQuery = async () => {
729
758
  try {
759
+ const __snapshot1 = performance.now();
730
760
  const client = await this.GetClient();
761
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
731
762
  const baseUrl = this.runner.options.fhirOptions.stsfhirbaseurl;
732
763
  const prefix = this.runner.options.personPrefix;
733
764
  const personRecord = await this.GetPersonRecord(prefix, this.runner.iteration, "3");
734
- performance.now();
765
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
735
766
  const url = new URL(`${baseUrl}/Person?family=${personRecord.name[0].family}`);
736
767
  let retVal;
737
768
  if (this.runner.options.useDirectQuery === true) {
@@ -740,8 +771,11 @@ var TestCaseFhir06 = class extends TestCaseFhirQueryBase {
740
771
  family: personRecord.name[0].family
741
772
  };
742
773
  retVal = await client.GenericSearchTesting("Person", data);
743
- } else retVal = await client.GetResources(url);
744
- performance.now();
774
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GenericSearchTesting()");
775
+ } else {
776
+ retVal = await client.GetResources(url);
777
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetResources()");
778
+ }
745
779
  return retVal.body;
746
780
  } catch (error) {
747
781
  this.runner.instrumentData.errorCount++;
@@ -1402,13 +1436,20 @@ var fast_json_patch_default = Object.assign({}, core_exports, duplex_exports, {
1402
1436
  var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1403
1437
  ExecuteQuery = async () => {
1404
1438
  try {
1439
+ const __snapshot1 = performance.now();
1405
1440
  const client = await this.GetClient();
1441
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1406
1442
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "3");
1407
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1443
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1444
+ const retVal = await client.GetResource("Person", personRecord.id);
1445
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1446
+ const resource = retVal.body;
1408
1447
  const observer = fast_json_patch_default.observe(resource);
1409
1448
  resource.text.div = `Json Patched record TestCaseFhir07 ${this.runner.iteration}`;
1410
1449
  const patchRecord = fast_json_patch_default.generate(observer);
1411
- return (await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`)).body;
1450
+ const retValPatched = await client.PatchResource("Person", personRecord.id, patchRecord, `application/json-patch+json`, `W/"3"`);
1451
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1452
+ return retValPatched.body;
1412
1453
  } catch (error) {
1413
1454
  this.runner.instrumentData.errorCount++;
1414
1455
  this.Error(`TestCaseFhir07:ExecuteQuery(): Error: [${error}]`);
@@ -1421,11 +1462,18 @@ var TestCaseFhir07 = class extends TestCaseFhirQueryBase {
1421
1462
  var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1422
1463
  ExecuteQuery = async () => {
1423
1464
  try {
1465
+ const __snapshot1 = performance.now();
1424
1466
  const client = await this.GetClient();
1467
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1425
1468
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "4");
1426
- const resource = (await client.GetResource("Person", personRecord.id)).body;
1469
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1470
+ const retVal = await client.GetResource("Person", personRecord.id);
1471
+ const __snapshot4 = this._CheckOutputLongDurationError(__snapshot3, "await this.GetResource()");
1472
+ const resource = retVal.body;
1427
1473
  resource.text.div = `Merge Patched record TestCaseFhir08 ${this.runner.iteration}`;
1428
- return (await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`)).body;
1474
+ const retValPatched = await client.PatchResource("Person", personRecord.id, resource, `application/merge-patch+json`, `W/"4"`);
1475
+ this._CheckOutputLongDurationError(__snapshot4, "await this.PatchResource()");
1476
+ return retValPatched.body;
1429
1477
  } catch (error) {
1430
1478
  this.runner.instrumentData.errorCount++;
1431
1479
  this.Error(`TestCaseFhir08:ExecuteQuery(): Error: [${error}]`);
@@ -1438,10 +1486,16 @@ var TestCaseFhir08 = class extends TestCaseFhirQueryBase {
1438
1486
  var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1439
1487
  ExecuteQuery = async () => {
1440
1488
  try {
1489
+ const __snapshot1 = performance.now();
1441
1490
  const client = await this.GetClient();
1491
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1442
1492
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "5");
1443
- if (personRecord.text) return (await client.DeleteResource("Person", personRecord.id, `W/"5"`)).body;
1444
- else {
1493
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1494
+ if (personRecord.text) {
1495
+ const retVal = await client.DeleteResource("Person", personRecord.id, `W/"5"`);
1496
+ this._CheckOutputLongDurationError(__snapshot3, "await this.DeleteResource()");
1497
+ return retVal.body;
1498
+ } else {
1445
1499
  this.runner.instrumentData.errorCount++;
1446
1500
  return null;
1447
1501
  }
@@ -1457,9 +1511,14 @@ var TestCaseFhir09 = class extends TestCaseFhirQueryBase {
1457
1511
  var TestCaseFhir10 = class extends TestCaseFhirQueryBase {
1458
1512
  ExecuteQuery = async () => {
1459
1513
  try {
1514
+ const __snapshot1 = performance.now();
1460
1515
  const client = await this.GetClient();
1516
+ const __snapshot2 = this._CheckOutputLongDurationError(__snapshot1, "await this.GetClient()");
1461
1517
  const personRecord = await this.GetPersonRecord(`${this.runner.options.personPrefix}`, this.runner.iteration, "1");
1462
- return (await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2")).body;
1518
+ const __snapshot3 = this._CheckOutputLongDurationError(__snapshot2, "await this.GetPersonRecord()");
1519
+ const retVal = await client.GetHistoryInstanceFhirResource("Person", personRecord.id, "2");
1520
+ this._CheckOutputLongDurationError(__snapshot3, "await this.GetHistoryInstanceFhirResource()");
1521
+ return retVal.body;
1463
1522
  } catch (error) {
1464
1523
  this.runner.instrumentData.errorCount++;
1465
1524
  this.Error(`TestCaseFhir10:ExecuteQuery(): Error: [${error}]`);