Hard-coded experimenter_test container name causes conflicts between concurrent worktrees

Open Beginner friendly
#14,768 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
docker

Research direction

Start in the Makefile at the listed lines and trace how COMPOSE_TEST_RUN, docker rm, and docker cp use the fixed experimenter_test name. Update those references to use a directory-derived name, then run make check or make lint from two concurrent worktrees to confirm their containers no longer conflict.

Written by the indexing model from the issue text.

Description

When running make check (or make lint) from two different git worktrees concurrently, the builds collide because the test container name experimenter_test is hard-coded in the Makefile:

COMPOSE_TEST_RUN = ${COMPOSE_TEST} run --name experimenter_test

All the docker rm experimenter_test and docker cp experimenter_test:... references also use this fixed name. When two worktrees try to run checks at the same time, the second one fails with:

Error response from daemon: Conflict. The container name "/experimenter_test" is already in use

Proposed fix: Derive the container name from the current directory so each worktree gets a unique name, e.g.:

TEST_CONTAINER_NAME = experimenter_test_$(notdir $(CURDIR))
COMPOSE_TEST_RUN = ${COMPOSE_TEST} run --name $(TEST_CONTAINER_NAME)

Then update all docker rm and docker cp lines to use $(TEST_CONTAINER_NAME) instead of the hard-coded string.

Affected lines in Makefile: 10, 174, 180, 182, 183, 185, 188, 305, 311, 315, 316

┆Issue is synchronized with this Jira Task

Dominant language
Python
Stars
151
Forks
229
Avg merge
1d 8h
Merged PRs (30d)
212

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla/experimenter

All issues in mozilla/experimenter

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.