Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/python/tests/unit/infra/test_dependency_conflicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ def test_install_kserve_with_feast(self):

# Assertions
assert exit_code == 0
conflict_occured = "dependency conflicts" in err and "ERROR" not in err
assert not conflict_occured, "Dependency conflict detected during installation"
conflict_occurred = "dependency conflicts" in err and "ERROR" not in err
assert not conflict_occurred, "Dependency conflict detected during installation"
Comment on lines +31 to +32
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Dependency conflict check condition is logically inverted, making the test ineffective

The condition on line 31 uses and to combine two checks, but this means actual pip dependency conflicts are never caught.

Root Cause

When pip detects dependency conflicts but still succeeds (exit code 0), it outputs to stderr a message like:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. Running pip check may reveal dependency conflicts.

The current condition is:

conflict_occurred = "dependency conflicts" in err and "ERROR" not in err

Since pip's conflict message contains BOTH "dependency conflicts" AND "ERROR", the evaluation is:

  • "dependency conflicts" in errTrue
  • "ERROR" not in errFalse
  • True and FalseFalse

So conflict_occurred is False, and assert not False passes. The test will never detect actual dependency conflicts from pip.

The condition should likely be:

conflict_occurred = "dependency conflicts" in err or "ERROR" in err

or simply:

conflict_occurred = "dependency conflicts" in err

Impact: The test is meant to catch dependency conflicts between Feast and KServe, but it will always pass regardless of whether conflicts exist, defeating its purpose.

Suggested change
conflict_occurred = "dependency conflicts" in err and "ERROR" not in err
assert not conflict_occurred, "Dependency conflict detected during installation"
conflict_occurred = "dependency conflicts" in err
assert not conflict_occurred, "Dependency conflict detected during installation"
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Loading