TestProject Forum

Unregister/remove Agent


By running the ephemeral docker agents, the list of agents gets quite longs quite fast.
I assume that is expected by the nature of the operation (register and use once).
Is there a way to clean-up, i.e. remove a registered agent from the list of registered agents.


Hi @stefanos.petrakis,

Generally after running on ephemeral docker agents, the agents should unregister themselves,
Make sure you have “TP_JOB_ID” field in the yaml file of your docker compose,

Hi Artem,

I tried that, it works as you describe. However, after reading the docs and from my experience so far, it doesn’t seem to be the case without a job id.
Which means I cannot run the tests on my local (e.g. via Python exported code), which is something important for us.
Could you confirm that?

Best and thanks for replying during the weekend,

Hi @stefanos.petrakis,

Sorry but I don’t think I understood,
why can’t you run the tests on your local environment?

I am running things at the moment following this => https://docs.testproject.io/testproject-agents/testproject-agent-in-docker#ephemeral-instances
The way the docker image (testproject/agent) works when I specify a Job ID, is to direct the selenium actions based on the test assigned to the job.
Which means, I just run the container, get the job and its tests executed and the container exits.

I am not sure how I am supposed to set this up to run:

  • In an ephemeral way (free resources, including temporary used agent as we originally discussed here)
  • Define my exported python code, which is executed locally (instead of having the test definition coming from app.testproject.io).
    I hope I made myself clear, let me know otherwise and I will try to explain better :slight_smile:

Thanks for the patience

Hi @stefanos.petrakis,

To run coded tests using TestProject’s Open SDK on docker agents you will have to create a bit different yaml file as described in here:


The Open SDK configuration is at the end of this document.

After you configured your yaml file correctly, you will need to spin the container by using:

docker-compose -f <file_name> up -d

After the container is up, you can run your code and it should execute on the Dockerized agent.
Note that if you configured a port that is different from 8585, you will have to change the: TP_AGENT_URL environment variable in your code.

You can also define multiple docker agents in your yaml file, each agent will be with a different port(each docker agent is a different service essentially), here is an example:

If you want to run your python scripts using Docker agents in an ephemeral way, you can do it by running those tests in a pipeline as described in this document: