Skip to content

Conversation

@ydshieh
Copy link
Collaborator

@ydshieh ydshieh commented Oct 16, 2025

What does this PR do?

This script (used to find which commits fail certain failing tests on our CI) fails recently, due to the fact that the warning sys:1: DeprecationWarning: builtin type swigvarlink has no __module__ attribute was written to stderr and we use stderr to check if there is error.

This is not a good approach, we should instead check result.returncode. Also a few improvements added along this here

raise ValueError(error_msg)
error_msg = f"Error when running git bisect:\nbash error: {result.stderr}\nbash output:\n{result.stdout}\nset `bad_commit` to `None`."
print(error_msg)
return None
Copy link
Collaborator Author

@ydshieh ydshieh Oct 16, 2025

Choose a reason for hiding this comment

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

Let's set it to None but not fail the whole script. We still want to continue to check the next failing test and find out which commit cause it.

Otherwise, we would not receive the reprot (the github action job using this script will fail)

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, let's see how many of the error logs above we get 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not much I believe, except those

DeprecationWarning: builtin type swigvarlink has no module attribute

being thought as error (before this PR), which is not.

@ydshieh ydshieh requested review from Cyrilvallez and vasqu October 16, 2025 13:19
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Contributor

@vasqu vasqu left a comment

Choose a reason for hiding this comment

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

Thx, lgtm overall

Do we want this to be a permanent solution or is it a workaround for now? Let's see how it fares

print("test failed")
exit(2)
exit(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: would we add print("test passed") before here now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

you mean before exit(0)? Good point, it's not always passed, it could be SKIPPED or anything that is not FAILED and ERROR.

I will add a print.

raise ValueError(error_msg)
error_msg = f"Error when running git bisect:\nbash error: {result.stderr}\nbash output:\n{result.stdout}\nset `bad_commit` to `None`."
print(error_msg)
return None
Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, let's see how many of the error logs above we get 😄

@ydshieh
Copy link
Collaborator Author

ydshieh commented Oct 16, 2025

Do we want this to be a permanent solution or is it a workaround for now? Let's see how it fares

Kind of, it is improved along the time: it's use git bisect (with subprocess) which calls a script (created on the fly) (a nested subprocess), so a bit complicated to handle the scenario.

Later, I will need to handle the flaky tests too to make the results more reliable.

@ydshieh ydshieh enabled auto-merge (squash) October 16, 2025 14:13
@ydshieh ydshieh merged commit 6344371 into main Oct 16, 2025
14 checks passed
@ydshieh ydshieh deleted the robust_bad_commit branch October 16, 2025 15:51
ydshieh added a commit that referenced this pull request Oct 17, 2025
* fix

* Update utils/check_bad_commit.py

Co-authored-by: Anton Vlasjuk <[email protected]>

* fix

* fix

* fix

---------

Co-authored-by: ydshieh <[email protected]>
Co-authored-by: Anton Vlasjuk <[email protected]>
ngazagna-qc pushed a commit to ngazagna-qc/transformers that referenced this pull request Oct 23, 2025
* robust

* robust

* robust

---------

Co-authored-by: ydshieh <[email protected]>
ngazagna-qc pushed a commit to ngazagna-qc/transformers that referenced this pull request Oct 23, 2025
…ingface#41690)

* fix

* Update utils/check_bad_commit.py

Co-authored-by: Anton Vlasjuk <[email protected]>

* fix

* fix

* fix

---------

Co-authored-by: ydshieh <[email protected]>
Co-authored-by: Anton Vlasjuk <[email protected]>
ydshieh added a commit that referenced this pull request Oct 24, 2025
…41815)

* 111

* fix

* fix

* fix

---------

Co-authored-by: ydshieh <[email protected]>
ngazagna-qc pushed a commit to ngazagna-qc/transformers that referenced this pull request Oct 24, 2025
i3hz pushed a commit to i3hz/transformers that referenced this pull request Oct 30, 2025
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.

4 participants