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

Revisit DuplicatedTestJob exception #1013

Open
chaws opened this issue Dec 8, 2021 · 0 comments
Open

Revisit DuplicatedTestJob exception #1013

chaws opened this issue Dec 8, 2021 · 0 comments
Labels

Comments

@chaws
Copy link
Collaborator

chaws commented Dec 8, 2021

SQUAD will not fetch a TestJob which job_id is already present in any TestRun of the Build. While this was the case for early days of SQUAD, that might not be the scenario anymore. Now we have multiple backends and occasionally it could happen that the same Build sent two TestJobs to two different backends and they return the same exact job_id in LAVA. It's very, very, very, very unlikely, but it could happen:

            job_id = metadata_fields.get('job_id')
            if job_id is None:
                metadata_fields['job_id'] = uuid.uuid4()
            elif build.test_runs.filter(job_id=job_id).exists():
                raise exceptions.DuplicatedTestJob("There is already a test run with job_id %s" % job_id)
@chaws chaws added the bug label Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant