@nsshunt/stsrunnerframework 1.0.91 → 1.0.93
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/stsrunnerframework.mjs +73 -71
- package/dist/stsrunnerframework.mjs.map +1 -1
- package/dist/stsrunnerframework.umd.js +73 -71
- package/dist/stsrunnerframework.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/workerInstance.d.ts.map +1 -1
- package/types/workerManager.d.ts +1 -1
- package/types/workerManager.d.ts.map +1 -1
|
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
var _collectorCollectorPort, _runners, _options, _workerId, _debug, _error, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _PostRunnersToWorkerManager, _StartRunner, _StopRunnerByRunnerId, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _messages,
|
|
12
|
+
var _collectorCollectorPort, _runners, _options, _workerId, _logMessage, _debug, _error, _warn, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _PostRunnersToWorkerManager, _StartRunner, _StopRunnerByRunnerId, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _messages, _logMessage2, _debug2, _error2, _processLoopExecutor2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitWorkerEvent, _EmitRunnerEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _UpdateOptionsRunner, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _UpdateOptionsWorker, _TerminateWorker, _BroadcastCommandToAllRunners, _HandleAllWorkers, _STSWorkerManager_instances, GetRunnersResponse_fn, _SyncRunnerData, _SyncWorkerDataFromPayload, _SyncWorkerDataFromWorker, _SyncWorkerDataFromWorkers, _PostMessageToWorkerGetRunners;
|
|
13
13
|
import { defaultLogger, Sleep, ModelDelimeter } from "@nsshunt/stsutils";
|
|
14
14
|
import { Gauge } from "@nsshunt/stsobservability";
|
|
15
15
|
const URI_BASE_VUEUTILS = "/";
|
|
@@ -1524,20 +1524,16 @@ class WorkerInstance {
|
|
|
1524
1524
|
__privateAdd(this, _runners, {});
|
|
1525
1525
|
__privateAdd(this, _options, null);
|
|
1526
1526
|
__privateAdd(this, _workerId, null);
|
|
1527
|
-
__privateAdd(this,
|
|
1527
|
+
__privateAdd(this, _logMessage, (fn, message) => {
|
|
1528
1528
|
if (__privateGet(this, _options)) {
|
|
1529
|
-
|
|
1529
|
+
fn(`pid: [${process.pid}] WorkerInstance: Worker ID: [${__privateGet(this, _workerId)}] Log: [${message}]`);
|
|
1530
1530
|
} else {
|
|
1531
|
-
|
|
1532
|
-
}
|
|
1533
|
-
});
|
|
1534
|
-
__privateAdd(this, _error, (error) => {
|
|
1535
|
-
if (__privateGet(this, _options)) {
|
|
1536
|
-
defaultLogger.error(chalk.red(`pid: [${process.pid}] ${__privateGet(this, _workerId)} WorkerInstance:${error}`));
|
|
1537
|
-
} else {
|
|
1538
|
-
defaultLogger.error(chalk.red(`pid: [${process.pid}] WorkerInstance:${error}`));
|
|
1531
|
+
fn(`pid: [${process.pid}] WorkerInstance: Log: [${message}]`);
|
|
1539
1532
|
}
|
|
1540
1533
|
});
|
|
1534
|
+
__privateAdd(this, _debug, (message) => __privateGet(this, _logMessage).call(this, defaultLogger.debug, message));
|
|
1535
|
+
__privateAdd(this, _error, (error) => __privateGet(this, _logMessage).call(this, defaultLogger.error, error));
|
|
1536
|
+
__privateAdd(this, _warn, (message) => __privateGet(this, _logMessage).call(this, defaultLogger.debug, message));
|
|
1541
1537
|
__privateAdd(this, _processLoopExecutor, async () => {
|
|
1542
1538
|
try {
|
|
1543
1539
|
const removeList = [];
|
|
@@ -1562,7 +1558,7 @@ class WorkerInstance {
|
|
|
1562
1558
|
setTimeout(__privateGet(this, _processLoopExecutor), 1e3);
|
|
1563
1559
|
}
|
|
1564
1560
|
} catch (error) {
|
|
1565
|
-
|
|
1561
|
+
__privateGet(this, _error).call(this, `#processLoopExecutor(): [${error}]`);
|
|
1566
1562
|
setTimeout(__privateGet(this, _processLoopExecutor), 1e3);
|
|
1567
1563
|
}
|
|
1568
1564
|
});
|
|
@@ -1596,7 +1592,7 @@ class WorkerInstance {
|
|
|
1596
1592
|
};
|
|
1597
1593
|
__privateGet(this, _collectorCollectorPort).postMessage(response);
|
|
1598
1594
|
} catch (error) {
|
|
1599
|
-
|
|
1595
|
+
__privateGet(this, _error).call(this, `#SetMessagePort(): [${error}]`);
|
|
1600
1596
|
}
|
|
1601
1597
|
});
|
|
1602
1598
|
__publicField(this, "CreateAsyncRunner", (testRunnerTelemetryPayload) => {
|
|
@@ -1611,7 +1607,7 @@ class WorkerInstance {
|
|
|
1611
1607
|
__privateGet(this, _runners)[runner.id].runner.iteration = 0;
|
|
1612
1608
|
__privateGet(this, _UpdateRunnerStateById).call(this, runner.id, IRunnerState.created);
|
|
1613
1609
|
} catch (error) {
|
|
1614
|
-
|
|
1610
|
+
__privateGet(this, _error).call(this, `#CreateRunnerEx2RunState(): [${error}]`);
|
|
1615
1611
|
}
|
|
1616
1612
|
});
|
|
1617
1613
|
__privateAdd(this, _UpdateRunnerStateById, (id, state) => {
|
|
@@ -1620,10 +1616,10 @@ class WorkerInstance {
|
|
|
1620
1616
|
__privateGet(this, _runners)[id].runner.state = state;
|
|
1621
1617
|
__privateGet(this, _PostMessageToWorkerManagerById).call(this, eIWMessageCommands.RunnerStateChange, id, false);
|
|
1622
1618
|
} else {
|
|
1623
|
-
|
|
1619
|
+
__privateGet(this, _warn).call(this, `#UpdateRunnerStateById(): Runner ID: [${id}] not found`);
|
|
1624
1620
|
}
|
|
1625
1621
|
} catch (error) {
|
|
1626
|
-
|
|
1622
|
+
__privateGet(this, _error).call(this, `#UpdateRunnerStateById(): [${error}]`);
|
|
1627
1623
|
}
|
|
1628
1624
|
});
|
|
1629
1625
|
__privateAdd(this, _GetAllRunners, () => {
|
|
@@ -1639,11 +1635,11 @@ class WorkerInstance {
|
|
|
1639
1635
|
}
|
|
1640
1636
|
return false;
|
|
1641
1637
|
} else {
|
|
1642
|
-
|
|
1638
|
+
__privateGet(this, _warn).call(this, `#CanExecuteNextIterationById(): Runner ID: [${id}] not found`);
|
|
1643
1639
|
return false;
|
|
1644
1640
|
}
|
|
1645
1641
|
} catch (error) {
|
|
1646
|
-
|
|
1642
|
+
__privateGet(this, _error).call(this, `#CanExecuteNextIterationById(): [${error}]`);
|
|
1647
1643
|
return false;
|
|
1648
1644
|
}
|
|
1649
1645
|
});
|
|
@@ -1657,11 +1653,11 @@ class WorkerInstance {
|
|
|
1657
1653
|
}
|
|
1658
1654
|
return false;
|
|
1659
1655
|
} else {
|
|
1660
|
-
|
|
1656
|
+
__privateGet(this, _warn).call(this, `#IsCompletedById(): Runner ID: [${id}] not found`);
|
|
1661
1657
|
return true;
|
|
1662
1658
|
}
|
|
1663
1659
|
} catch (error) {
|
|
1664
|
-
|
|
1660
|
+
__privateGet(this, _error).call(this, `#IsCompletedById(): [${error}]`);
|
|
1665
1661
|
return true;
|
|
1666
1662
|
}
|
|
1667
1663
|
});
|
|
@@ -1670,11 +1666,11 @@ class WorkerInstance {
|
|
|
1670
1666
|
if (__privateGet(this, _runners)[id]) {
|
|
1671
1667
|
return __privateGet(this, _runners)[id].runner.iteration;
|
|
1672
1668
|
} else {
|
|
1673
|
-
|
|
1669
|
+
__privateGet(this, _warn).call(this, `#GetRunnerIterationById(): Runner ID: [${id}] not found`);
|
|
1674
1670
|
return 0;
|
|
1675
1671
|
}
|
|
1676
1672
|
} catch (error) {
|
|
1677
|
-
|
|
1673
|
+
__privateGet(this, _error).call(this, `#GetRunnerIterationById(): [${error}]`);
|
|
1678
1674
|
return 0;
|
|
1679
1675
|
}
|
|
1680
1676
|
});
|
|
@@ -1684,11 +1680,11 @@ class WorkerInstance {
|
|
|
1684
1680
|
__privateGet(this, _runners)[id].runner.iteration = 0;
|
|
1685
1681
|
return 0;
|
|
1686
1682
|
} else {
|
|
1687
|
-
|
|
1683
|
+
__privateGet(this, _warn).call(this, `#ResetRunnerIterationById(): Runner ID: [${id}] not found`);
|
|
1688
1684
|
return 0;
|
|
1689
1685
|
}
|
|
1690
1686
|
} catch (error) {
|
|
1691
|
-
|
|
1687
|
+
__privateGet(this, _error).call(this, `#ResetRunnerIterationById(): [${error}]`);
|
|
1692
1688
|
return 0;
|
|
1693
1689
|
}
|
|
1694
1690
|
});
|
|
@@ -1698,11 +1694,11 @@ class WorkerInstance {
|
|
|
1698
1694
|
__privateGet(this, _runners)[id].runner.iteration++;
|
|
1699
1695
|
return __privateGet(this, _runners)[id].runner.iteration;
|
|
1700
1696
|
} else {
|
|
1701
|
-
|
|
1697
|
+
__privateGet(this, _warn).call(this, `#IncRunnerIterationById(): Runner ID: [${id}] not found`);
|
|
1702
1698
|
return 0;
|
|
1703
1699
|
}
|
|
1704
1700
|
} catch (error) {
|
|
1705
|
-
|
|
1701
|
+
__privateGet(this, _error).call(this, `#IncRunnerIterationById(): [${error}]`);
|
|
1706
1702
|
return 0;
|
|
1707
1703
|
}
|
|
1708
1704
|
});
|
|
@@ -1711,10 +1707,10 @@ class WorkerInstance {
|
|
|
1711
1707
|
if (__privateGet(this, _runners)[id]) {
|
|
1712
1708
|
return __privateGet(this, _runners)[id].runnerInstance;
|
|
1713
1709
|
} else {
|
|
1714
|
-
|
|
1710
|
+
__privateGet(this, _warn).call(this, `#GetRunnerInstanceById(): Runner ID: [${id}] not found`);
|
|
1715
1711
|
}
|
|
1716
1712
|
} catch (error) {
|
|
1717
|
-
|
|
1713
|
+
__privateGet(this, _error).call(this, `#GetRunnerInstanceById(): [${error}]`);
|
|
1718
1714
|
}
|
|
1719
1715
|
});
|
|
1720
1716
|
__privateAdd(this, _GetRunnerExecutionProfileById, (id) => {
|
|
@@ -1722,10 +1718,10 @@ class WorkerInstance {
|
|
|
1722
1718
|
if (__privateGet(this, _runners)[id]) {
|
|
1723
1719
|
return __privateGet(this, _runners)[id].runner.options.executionProfile;
|
|
1724
1720
|
} else {
|
|
1725
|
-
|
|
1721
|
+
__privateGet(this, _warn).call(this, `#GetRunnerExecutionProfileById(): Runner ID: [${id}] not found`);
|
|
1726
1722
|
}
|
|
1727
1723
|
} catch (error) {
|
|
1728
|
-
|
|
1724
|
+
__privateGet(this, _error).call(this, `#GetRunnerExecutionProfileById(): [${error}]`);
|
|
1729
1725
|
}
|
|
1730
1726
|
});
|
|
1731
1727
|
__privateAdd(this, _GetRunnerOptionsById, (id) => {
|
|
@@ -1733,10 +1729,10 @@ class WorkerInstance {
|
|
|
1733
1729
|
if (__privateGet(this, _runners)[id]) {
|
|
1734
1730
|
return __privateGet(this, _runners)[id].runner.options;
|
|
1735
1731
|
} else {
|
|
1736
|
-
|
|
1732
|
+
__privateGet(this, _warn).call(this, `#GetRunnerOptionsById(): Runner ID: [${id}] not found`);
|
|
1737
1733
|
}
|
|
1738
1734
|
} catch (error) {
|
|
1739
|
-
|
|
1735
|
+
__privateGet(this, _error).call(this, `#GetRunnerOptionsById(): [${error}]`);
|
|
1740
1736
|
}
|
|
1741
1737
|
});
|
|
1742
1738
|
__privateAdd(this, _SetRunnerOptionsById, (id, options) => {
|
|
@@ -1745,10 +1741,10 @@ class WorkerInstance {
|
|
|
1745
1741
|
__privateGet(this, _runners)[id].runner.options = { ...options };
|
|
1746
1742
|
return __privateGet(this, _runners)[id].runner.options;
|
|
1747
1743
|
} else {
|
|
1748
|
-
|
|
1744
|
+
__privateGet(this, _warn).call(this, `#SetRunnerOptionsById(): Runner ID: [${id}] not found`);
|
|
1749
1745
|
}
|
|
1750
1746
|
} catch (error) {
|
|
1751
|
-
|
|
1747
|
+
__privateGet(this, _error).call(this, `#SetRunnerOptionsById(): [${error}]`);
|
|
1752
1748
|
}
|
|
1753
1749
|
});
|
|
1754
1750
|
__privateAdd(this, _AddRunner, (testRunnerTelemetryPayload) => {
|
|
@@ -1758,11 +1754,11 @@ class WorkerInstance {
|
|
|
1758
1754
|
if (asyncRunnerInstance) {
|
|
1759
1755
|
__privateGet(this, _CreateRunnerEx2RunState).call(this, runner, asyncRunnerInstance);
|
|
1760
1756
|
} else {
|
|
1761
|
-
|
|
1757
|
+
__privateGet(this, _warn).call(this, `#AddRunner(): CreateAsyncRunner not defined.`);
|
|
1762
1758
|
}
|
|
1763
1759
|
return runner;
|
|
1764
1760
|
} catch (error) {
|
|
1765
|
-
|
|
1761
|
+
__privateGet(this, _error).call(this, `#AddRunner(): [${error}]`);
|
|
1766
1762
|
}
|
|
1767
1763
|
});
|
|
1768
1764
|
__privateAdd(this, _PostMessageToWorkerManagerById, async (command, runnerId, response) => {
|
|
@@ -1780,7 +1776,7 @@ class WorkerInstance {
|
|
|
1780
1776
|
}
|
|
1781
1777
|
}
|
|
1782
1778
|
} catch (error) {
|
|
1783
|
-
|
|
1779
|
+
__privateGet(this, _error).call(this, `#PostMessageToWorkerManagerById(): [${error}]`);
|
|
1784
1780
|
}
|
|
1785
1781
|
});
|
|
1786
1782
|
__privateAdd(this, _PostRunnersToWorkerManager, async (command, messagePayload) => {
|
|
@@ -1798,7 +1794,7 @@ class WorkerInstance {
|
|
|
1798
1794
|
await Sleep(0);
|
|
1799
1795
|
}
|
|
1800
1796
|
} catch (error) {
|
|
1801
|
-
|
|
1797
|
+
__privateGet(this, _error).call(this, `#PostRunnersToWorkerManager(): [${error}]`);
|
|
1802
1798
|
}
|
|
1803
1799
|
});
|
|
1804
1800
|
__privateAdd(this, _StartRunner, async (testRunnerTelemetryPayload) => {
|
|
@@ -1846,15 +1842,15 @@ class WorkerInstance {
|
|
|
1846
1842
|
__privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.completed);
|
|
1847
1843
|
}
|
|
1848
1844
|
} else {
|
|
1849
|
-
|
|
1845
|
+
__privateGet(this, _warn).call(this, `#StartRunner:ExecuteLoop(): Cannot get execution profile for runner: [${runnerId}]`);
|
|
1850
1846
|
}
|
|
1851
1847
|
} catch (error) {
|
|
1852
|
-
|
|
1848
|
+
__privateGet(this, _error).call(this, `#StartRunner:ExecuteLoop(): Error: [${error}]`);
|
|
1853
1849
|
}
|
|
1854
1850
|
};
|
|
1855
1851
|
ExecuteLoop();
|
|
1856
1852
|
} catch (error) {
|
|
1857
|
-
|
|
1853
|
+
__privateGet(this, _error).call(this, `#StartRunner(): Error: [${error}]`);
|
|
1858
1854
|
}
|
|
1859
1855
|
});
|
|
1860
1856
|
__privateAdd(this, _StopRunnerByRunnerId, async (id) => {
|
|
@@ -1864,7 +1860,7 @@ class WorkerInstance {
|
|
|
1864
1860
|
await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, id)) == null ? void 0 : _a.StopRunner());
|
|
1865
1861
|
await __privateGet(this, _UpdateRunnerStateById).call(this, id, IRunnerState.stopped);
|
|
1866
1862
|
} catch (error) {
|
|
1867
|
-
|
|
1863
|
+
__privateGet(this, _error).call(this, `#StopRunnerByRunnerId(): Error: [${error}]`);
|
|
1868
1864
|
}
|
|
1869
1865
|
});
|
|
1870
1866
|
__privateAdd(this, _StopAllRunners, async (testRunnerTelemetryPayload) => {
|
|
@@ -1877,14 +1873,14 @@ class WorkerInstance {
|
|
|
1877
1873
|
await Promise.all(promArray);
|
|
1878
1874
|
await Sleep(0);
|
|
1879
1875
|
} catch (error) {
|
|
1880
|
-
|
|
1876
|
+
__privateGet(this, _error).call(this, `#StopAllRunners(): Error: [${error}]`);
|
|
1881
1877
|
}
|
|
1882
1878
|
});
|
|
1883
1879
|
__privateAdd(this, _StopRunner, async (testRunnerTelemetryPayload) => {
|
|
1884
1880
|
try {
|
|
1885
1881
|
await __privateGet(this, _StopRunnerByRunnerId).call(this, testRunnerTelemetryPayload.runner.id);
|
|
1886
1882
|
} catch (error) {
|
|
1887
|
-
|
|
1883
|
+
__privateGet(this, _error).call(this, `#StopRunner(): Error: [${error}]`);
|
|
1888
1884
|
}
|
|
1889
1885
|
});
|
|
1890
1886
|
__privateAdd(this, _TerminateRunner, async (testRunnerTelemetryPayload) => {
|
|
@@ -1896,7 +1892,7 @@ class WorkerInstance {
|
|
|
1896
1892
|
await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.terminated);
|
|
1897
1893
|
__privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} TerminateRunner Result = [${retVal}]`);
|
|
1898
1894
|
} catch (error) {
|
|
1899
|
-
|
|
1895
|
+
__privateGet(this, _error).call(this, `#TerminateRunner(): Error: [${error}]`);
|
|
1900
1896
|
}
|
|
1901
1897
|
});
|
|
1902
1898
|
__privateAdd(this, _PauseRunner, async (testRunnerTelemetryPayload) => {
|
|
@@ -1907,7 +1903,7 @@ class WorkerInstance {
|
|
|
1907
1903
|
await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.PauseRunner());
|
|
1908
1904
|
await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
|
|
1909
1905
|
} catch (error) {
|
|
1910
|
-
|
|
1906
|
+
__privateGet(this, _error).call(this, `#PauseRunner(): Error: [${error}]`);
|
|
1911
1907
|
}
|
|
1912
1908
|
});
|
|
1913
1909
|
__privateAdd(this, _ResumeRunner, async (testRunnerTelemetryPayload) => {
|
|
@@ -1918,7 +1914,7 @@ class WorkerInstance {
|
|
|
1918
1914
|
await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.ResumeRunner());
|
|
1919
1915
|
await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.running);
|
|
1920
1916
|
} catch (error) {
|
|
1921
|
-
|
|
1917
|
+
__privateGet(this, _error).call(this, `#ResumeRunner(): Error: [${error}]`);
|
|
1922
1918
|
}
|
|
1923
1919
|
});
|
|
1924
1920
|
__privateAdd(this, _ResetRunner, async (testRunnerTelemetryPayload) => {
|
|
@@ -1930,7 +1926,7 @@ class WorkerInstance {
|
|
|
1930
1926
|
await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.ResetRunner());
|
|
1931
1927
|
await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
|
|
1932
1928
|
} catch (error) {
|
|
1933
|
-
|
|
1929
|
+
__privateGet(this, _error).call(this, `#ResetRunner(): Error: [${error}]`);
|
|
1934
1930
|
}
|
|
1935
1931
|
});
|
|
1936
1932
|
// Execute a single iteration of this runners work item
|
|
@@ -1945,7 +1941,7 @@ class WorkerInstance {
|
|
|
1945
1941
|
__privateGet(this, _debug).call(this, `${chalk.magenta(` --> runner: [${runnerId}]`)} Next iteration number: [${newIteration}] for next Execute or Resume.`);
|
|
1946
1942
|
await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
|
|
1947
1943
|
} catch (error) {
|
|
1948
|
-
|
|
1944
|
+
__privateGet(this, _error).call(this, `#ExecuteRunner(): Error: [${error}]`);
|
|
1949
1945
|
}
|
|
1950
1946
|
});
|
|
1951
1947
|
__privateAdd(this, _UpdateOptions, async (testRunnerTelemetryPayload) => {
|
|
@@ -1959,7 +1955,7 @@ class WorkerInstance {
|
|
|
1959
1955
|
await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.UpdateOptions());
|
|
1960
1956
|
await Sleep(0);
|
|
1961
1957
|
} catch (error) {
|
|
1962
|
-
|
|
1958
|
+
__privateGet(this, _error).call(this, `#UpdateOptions(): Error: [${error}]`);
|
|
1963
1959
|
}
|
|
1964
1960
|
});
|
|
1965
1961
|
// ProcessMessage = async(data: MessageEvent) => { // Browser version
|
|
@@ -2023,7 +2019,7 @@ class WorkerInstance {
|
|
|
2023
2019
|
__privateGet(this, _debug).call(this, `Invalid payloadMessage.command: [${payloadMessage.command}] - Ignoring`);
|
|
2024
2020
|
}
|
|
2025
2021
|
} catch (error) {
|
|
2026
|
-
|
|
2022
|
+
__privateGet(this, _error).call(this, `ProcessMessage(): Error: [${error}]`);
|
|
2027
2023
|
__privateGet(this, _error).call(this, error);
|
|
2028
2024
|
}
|
|
2029
2025
|
});
|
|
@@ -2041,8 +2037,10 @@ _collectorCollectorPort = new WeakMap();
|
|
|
2041
2037
|
_runners = new WeakMap();
|
|
2042
2038
|
_options = new WeakMap();
|
|
2043
2039
|
_workerId = new WeakMap();
|
|
2040
|
+
_logMessage = new WeakMap();
|
|
2044
2041
|
_debug = new WeakMap();
|
|
2045
2042
|
_error = new WeakMap();
|
|
2043
|
+
_warn = new WeakMap();
|
|
2046
2044
|
_processLoopExecutor = new WeakMap();
|
|
2047
2045
|
_SetMessagePort = new WeakMap();
|
|
2048
2046
|
_CreateRunnerEx2RunState = new WeakMap();
|
|
@@ -2229,6 +2227,11 @@ class STSWorkerManager {
|
|
|
2229
2227
|
__privateAdd(this, _archiveList, []);
|
|
2230
2228
|
__privateAdd(this, _id);
|
|
2231
2229
|
__privateAdd(this, _messages, {});
|
|
2230
|
+
__privateAdd(this, _logMessage2, (fn, message) => {
|
|
2231
|
+
fn(`pid: [${process.pid}] STSWorkerManager: ID: [${__privateGet(this, _id)}] Log: [${message}]`);
|
|
2232
|
+
});
|
|
2233
|
+
__privateAdd(this, _debug2, (message) => __privateGet(this, _logMessage2).call(this, defaultLogger.debug, message));
|
|
2234
|
+
__privateAdd(this, _error2, (error) => __privateGet(this, _logMessage2).call(this, defaultLogger.error, error));
|
|
2232
2235
|
__privateAdd(this, _processLoopExecutor2, async () => {
|
|
2233
2236
|
const removeList = [];
|
|
2234
2237
|
for (const [, workerEx] of Object.entries(__privateGet(this, _workersEx))) {
|
|
@@ -2274,9 +2277,6 @@ class STSWorkerManager {
|
|
|
2274
2277
|
setTimeout(__privateGet(this, _processLoopExecutor2), 1e3);
|
|
2275
2278
|
}
|
|
2276
2279
|
});
|
|
2277
|
-
__privateAdd(this, _debug2, (message) => {
|
|
2278
|
-
console.log(chalk.cyan(`pid: [${process.pid}] STSWorkerManager::${message}`));
|
|
2279
|
-
});
|
|
2280
2280
|
__publicField(this, "GetWorkers", async () => {
|
|
2281
2281
|
await __privateGet(this, _SyncWorkerDataFromWorkers).call(this);
|
|
2282
2282
|
const retVal = {};
|
|
@@ -2377,43 +2377,43 @@ class STSWorkerManager {
|
|
|
2377
2377
|
if (isNode) {
|
|
2378
2378
|
stsWorkerEx.worker.on("exit", (code) => {
|
|
2379
2379
|
try {
|
|
2380
|
-
|
|
2380
|
+
__privateGet(this, _debug2).call(this, chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.on(exit): Worker exited with code: ${code}`));
|
|
2381
2381
|
__privateGet(this, _EmitWorkerEvent).call(this, "exit", stsWorkerEx);
|
|
2382
2382
|
if (__privateGet(this, _workersEx)[stsWorkerEx.id]) {
|
|
2383
2383
|
delete __privateGet(this, _workersEx)[stsWorkerEx.id];
|
|
2384
|
-
|
|
2384
|
+
__privateGet(this, _debug2).call(this, chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.on(exit): Worker: [${stsWorkerEx.id}] has been removed from the worker collection.`));
|
|
2385
2385
|
}
|
|
2386
2386
|
} catch (error) {
|
|
2387
|
-
|
|
2387
|
+
__privateGet(this, _error2).call(this, chalk.red(`STSWorkerManager:stsWorkerEx.worker.on(exit): Error: [${error}] Worker: [${stsWorkerEx.id}]`));
|
|
2388
2388
|
}
|
|
2389
2389
|
});
|
|
2390
2390
|
stsWorkerEx.worker.on("error", (error) => {
|
|
2391
2391
|
try {
|
|
2392
|
-
|
|
2392
|
+
__privateGet(this, _error2).call(this, chalk.red(`STSWorkerManager:stsWorkerEx.worker.on(error): Worker error: ${error}`));
|
|
2393
2393
|
__privateGet(this, _EmitWorkerEvent).call(this, "error", stsWorkerEx);
|
|
2394
2394
|
} catch (error2) {
|
|
2395
|
-
|
|
2395
|
+
__privateGet(this, _error2).call(this, chalk.red(`STSWorkerManager:stsWorkerEx.worker.on(error): Error: [${error2}] Worker: [${stsWorkerEx.id}]`));
|
|
2396
2396
|
}
|
|
2397
2397
|
});
|
|
2398
2398
|
} else {
|
|
2399
2399
|
stsWorkerEx.worker.onerror = (error) => {
|
|
2400
2400
|
try {
|
|
2401
|
-
|
|
2401
|
+
__privateGet(this, _error2).call(this, chalk.red("STSWorkerManager:stsWorkerEx.worker.onerror(): Error in worker:", error));
|
|
2402
2402
|
__privateGet(this, _EmitWorkerEvent).call(this, "onerror", stsWorkerEx);
|
|
2403
2403
|
if (__privateGet(this, _workersEx)[stsWorkerEx.id]) {
|
|
2404
2404
|
delete __privateGet(this, _workersEx)[stsWorkerEx.id];
|
|
2405
|
-
|
|
2405
|
+
__privateGet(this, _debug2).call(this, chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.onerror(error): Worker: [${stsWorkerEx.id}] has been removed from the worker collection.`));
|
|
2406
2406
|
}
|
|
2407
2407
|
} catch (error2) {
|
|
2408
|
-
|
|
2408
|
+
__privateGet(this, _error2).call(this, chalk.red(`STSWorkerManager:stsWorkerEx.worker.onerror(error): Error: [${error2}] Worker: [${stsWorkerEx.id}]`));
|
|
2409
2409
|
}
|
|
2410
2410
|
};
|
|
2411
2411
|
stsWorkerEx.worker.onmessageerror = (error) => {
|
|
2412
2412
|
try {
|
|
2413
|
-
|
|
2413
|
+
__privateGet(this, _error2).call(this, chalk.red("STSWorkerManager:stsWorkerEx.worker.onmessageerror(): Message error in worker:", error));
|
|
2414
2414
|
__privateGet(this, _EmitWorkerEvent).call(this, "onmessageerror", stsWorkerEx);
|
|
2415
2415
|
} catch (error2) {
|
|
2416
|
-
|
|
2416
|
+
__privateGet(this, _error2).call(this, chalk.red(`STSWorkerManager:stsWorkerEx.worker.onmessageerror(error): Error: [${error2}] Worker: [${stsWorkerEx.id}]`));
|
|
2417
2417
|
}
|
|
2418
2418
|
};
|
|
2419
2419
|
}
|
|
@@ -2533,7 +2533,7 @@ class STSWorkerManager {
|
|
|
2533
2533
|
#ProcessCompleted = (workerEx: IWorkerEx, payloadContents: ITestRunnerTelemetryPayload): void => {
|
|
2534
2534
|
const { runner } = payloadContents;
|
|
2535
2535
|
this.#EmitEvent('Completed', workerEx, runner.id);
|
|
2536
|
-
|
|
2536
|
+
this.#debug(chalk.green(`ProcessCompleted: [${JSON.stringify(runner)}]`));
|
|
2537
2537
|
}
|
|
2538
2538
|
*/
|
|
2539
2539
|
__privateAdd(this, _CreateAsyncRunner, (workerEx, runnerOptions) => {
|
|
@@ -2737,13 +2737,13 @@ class STSWorkerManager {
|
|
|
2737
2737
|
__privateGet(this, _debug2).call(this, `Terminated worker: [${workerEx.id}]`);
|
|
2738
2738
|
if (__privateGet(this, _workersEx)[workerEx.id]) {
|
|
2739
2739
|
delete __privateGet(this, _workersEx)[workerEx.id];
|
|
2740
|
-
|
|
2740
|
+
__privateGet(this, _debug2).call(this, chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.on(exit): Worker: [${workerEx.id}] has been removed from the worker collection.`));
|
|
2741
2741
|
}
|
|
2742
2742
|
}, 500);
|
|
2743
2743
|
}
|
|
2744
2744
|
return retVal;
|
|
2745
2745
|
} catch (error) {
|
|
2746
|
-
|
|
2746
|
+
__privateGet(this, _debug2).call(this, `Error in STSTestWorker:TerminateWorker: [${error}]`);
|
|
2747
2747
|
return [];
|
|
2748
2748
|
}
|
|
2749
2749
|
});
|
|
@@ -2760,7 +2760,7 @@ class STSWorkerManager {
|
|
|
2760
2760
|
};
|
|
2761
2761
|
return Object.values(workerEx.runnersEx).map((runnerEx) => executeCommand(runnerEx));
|
|
2762
2762
|
} catch (error) {
|
|
2763
|
-
|
|
2763
|
+
__privateGet(this, _error2).call(this, `Error in STSTestWorker:WorkerCommand: [${error}]`);
|
|
2764
2764
|
return [];
|
|
2765
2765
|
}
|
|
2766
2766
|
});
|
|
@@ -2875,7 +2875,7 @@ class STSWorkerManager {
|
|
|
2875
2875
|
};
|
|
2876
2876
|
workerEx.messagePort.postMessage({ command, payload });
|
|
2877
2877
|
} catch (error) {
|
|
2878
|
-
|
|
2878
|
+
__privateGet(this, _error2).call(this, `#PostMessageToWorkerGetRunners(): Error: [${error}]`);
|
|
2879
2879
|
}
|
|
2880
2880
|
});
|
|
2881
2881
|
});
|
|
@@ -2943,8 +2943,10 @@ _telemetryProcessor = new WeakMap();
|
|
|
2943
2943
|
_archiveList = new WeakMap();
|
|
2944
2944
|
_id = new WeakMap();
|
|
2945
2945
|
_messages = new WeakMap();
|
|
2946
|
-
|
|
2946
|
+
_logMessage2 = new WeakMap();
|
|
2947
2947
|
_debug2 = new WeakMap();
|
|
2948
|
+
_error2 = new WeakMap();
|
|
2949
|
+
_processLoopExecutor2 = new WeakMap();
|
|
2948
2950
|
_SetRunnerIntoWorker = new WeakMap();
|
|
2949
2951
|
_ProcessTelemetry = new WeakMap();
|
|
2950
2952
|
_EmitWorkerEvent = new WeakMap();
|
|
@@ -2995,7 +2997,7 @@ GetRunnersResponse_fn = function(stsWorkerEx, payload) {
|
|
|
2995
2997
|
messageRecord.resolveMessage(returnPayload);
|
|
2996
2998
|
}
|
|
2997
2999
|
} catch (error) {
|
|
2998
|
-
|
|
3000
|
+
__privateGet(this, _error2).call(this, `#GetRunnersResponse(): Error: [${error}]`);
|
|
2999
3001
|
}
|
|
3000
3002
|
};
|
|
3001
3003
|
_SyncRunnerData = new WeakMap();
|