Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Garfonso opened this issue Apr 11, 2022 · 5 comments
Assignees

Comments

@Garfonso
Copy link

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.

@AlCalzone
Copy link
Collaborator

Something is active on port 9000/9001

@Garfonso
Copy link
Author

Ok, that's true. Hm.

@Garfonso
Copy link
Author

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

@AlCalzone
Copy link
Collaborator

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

@AlCalzone AlCalzone reopened this Apr 12, 2022
@AlCalzone AlCalzone self-assigned this Apr 12, 2022
@mcm1957
Copy link
Contributor

mcm1957 commented Apr 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants