ioBroker/testing

Local run of integration tests fails instant with "js-controller running" error

Garfonso opened this issue · 5 comments

Not sure what is happening... the test directory is not even created:

`
/usr/bin/node /home/achim/development/iobroker/ioBroker.lovelace/node_modules/mocha/bin/mocha --timeout 10000 --exit --ui bdd /home/achim/development/iobroker/ioBroker.lovelace/test/integration.js

Running tests in /tmp/test-iobroker.lovelace

Test the adapter (in a live environment)
1) "before all" hook for "The adapter starts"

0 passing (4ms)
1 failing

  1. Test the adapter (in a live environment)
    "before all" hook for "The adapter starts":
    Error: JS-Controller is already running! Stop it for the first test run and try again!
    at Context. (node_modules/@iobroker/testing/build/tests/integration/index.js:54:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

`

Any idea what could cause this issue?

This is on an Arch Linux System. Frankly, tests worked fine on Windows. Hm.

Something is active on port 9000/9001

Ok, that's true. Hm.

Ok, so nothing to do here (or maybe give a hint in the error message? Not sure). Sorry for the false alarm.

I can try to check and see how dev-server does it.

Tests should search for a free port.

Its annoying to be forced to stop a locally running js-controller before beeing able to use npm run test:integration. As the testing js-controller is not even accessed (at least normally) using web port, a random port should be OK.

dev-server allows to specify adifferent admin port during setup. So its possible to run a dev-sever in parallel to a local test server. I would suggest the test js-controller tries to fund a free port logging this fact so that someone can react if this is causing problems.