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

Fix crashitem names mismatch between client and server. #173

Merged
merged 3 commits into from
Aug 25, 2023

Conversation

esoma
Copy link
Contributor

@esoma esoma commented Nov 23, 2021

Fixes #172.

The identifier used for the failures/reruns DB is inconsistent, on the client side it is built as:

item_location = (item.location[0] + "::" + item.location[2]).replace("\\", "/")
db = item.session.config.failures_db
item.execution_count = db.get_test_failures(item_location)
db.set_test_reruns(item_location, reruns)

But on the server:

reruns = db.get_test_reruns(crashitem)
if db.get_test_failures(crashitem) < reruns:

This can lead to inconsistent behavior with crash restarts. Sometimes the client side will create an identifier that consists of a full/absolute path while the server's identifier only contains the relative part. As a result, the server gets reruns as 0 and doesn't do a rerun.

@icemac icemac requested a review from sallner December 3, 2021 06:58
Copy link
Contributor

@icemac icemac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@icemac icemac merged commit 96bbc4f into pytest-dev:master Aug 25, 2023
45 checks passed
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

Successfully merging this pull request may close these issues.

Rerun on crash is flaky
2 participants