@iobroker/legacy-testing 1.0.10 → 1.0.11

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.
Files changed (3) hide show
  1. package/README.md +3 -0
  2. package/package.json +1 -1
  3. package/setup.js +26 -2
package/README.md CHANGED
@@ -14,6 +14,9 @@ Set process.env.JS_CONTROLLER_VERSION to version e.g. `5.0.5-alpha.0-20230617-46
14
14
 
15
15
  ## Changelog
16
16
  <!-- ### **WORK IN PROGRESS** -->
17
+ ### 1.0.11 (2024-04-14)
18
+ * (bluefox) Added support for the once mode
19
+
17
20
  ### 1.0.10 (2024-04-10)
18
21
  * (bluefox) Added support for vis-2 testing
19
22
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.10",
2
+ "version": "1.0.11",
3
3
  "name": "@iobroker/legacy-testing",
4
4
  "main": "setup.js",
5
5
  "files": [
package/setup.js CHANGED
@@ -711,6 +711,27 @@ function startCustomAdapter(adapterName, adapterInstance) {
711
711
  stdio: [0, 1, 2, 'ipc'],
712
712
  });
713
713
  }
714
+ pids[id].on('exit', (code, signal) => {
715
+ if (pids[id]) {
716
+ console.log(`child process terminated 1 due to receipt of signal ${signal}`);
717
+ let resolve = pids[id].customResolve;
718
+ if (resolve) {
719
+ delete pids[id].customResolve;
720
+ }
721
+ pids[id] = null;
722
+ resolve && resolve();
723
+ }
724
+ });
725
+ pids[id].on('close', () => {
726
+ if (pids[id]) {
727
+ let resolve = pids[id].customResolve;
728
+ if (resolve) {
729
+ delete pids[id].customResolve;
730
+ }
731
+ pids[id] = null;
732
+ resolve && resolve();
733
+ }
734
+ });
714
735
  } catch (error) {
715
736
  console.error(JSON.stringify(error));
716
737
  }
@@ -853,16 +874,19 @@ function stopCustomAdapter(adapterName, adapterInstance) {
853
874
  } else {
854
875
  adaptersStarted[id] = false;
855
876
  return new Promise(resolve => {
877
+ pids[id].customResolve = resolve;
856
878
  pids[id].on('exit', (code, signal) => {
857
879
  if (pids[id]) {
858
- console.log(`child process terminated due to receipt of signal ${signal}`);
880
+ console.log(`child process terminated 3 due to receipt of signal ${signal}`);
881
+ delete pids[id].customResolve;
859
882
  pids[id] = null;
860
883
  resolve();
861
884
  }
862
885
  });
863
886
 
864
- pids[id].on('close', (/* code, signal */) => {
887
+ pids[id].on('close', () => {
865
888
  if (pids[id]) {
889
+ delete pids[id].customResolve;
866
890
  pids[id] = null;
867
891
  resolve();
868
892
  }