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

Fixing index & type errors in prime_offload_tester.py (Bugfix) #1588

Merged
merged 6 commits into from
Nov 22, 2024

Conversation

tomli380576
Copy link
Contributor

@tomli380576 tomli380576 commented Nov 8, 2024

Description

This PR fixes the issue in the Resolved Issues section and replaced some type annotations with ones supported in python 3.5

Resolved issues

If prime_offload_tester.py was run with arguments like python3 prime_offload_tester.py -d i915 -p 0000:00:02.0 and the command to check is glxgears, the test always passes because it was checking if "glxgears"[0] is one of the clients of this GPU. Since "glxgears"[0] == 'g', it always matches the g in "tgid" in /sys/kernel/debug/dri/<card_pci_id>/clients.

command  tgid dev master a   uid      magic
systemd-logind  1124   1   y    y     0          0
      Xwayland  3014 128   n    n  1000          0
 gsd-xsettings  3403 128   n    n  1000          0
          code  4943 128   n    n  1000          0
          code  4943 128   n    n  1000          0
          code  4943 128   n    n  1000          0
xdg-desktop-por  3317 128   n    n  1000          0

Now it will check if the entire string "glxgears" appears in the file

Documentation

Tests

Unit tests
Ran the script on 202408-34290 with -d i915 -p 0000:00:02.0 (Intel + NVIDIA desktop, expected to fail) and it correctly reports that prime offload didn't work

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 48.00%. Comparing base (7b5dd02) to head (81fe325).
Report is 29 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/prime_offload_tester.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1588   +/-   ##
=======================================
  Coverage   48.00%   48.00%           
=======================================
  Files         371      371           
  Lines       39833    39837    +4     
  Branches     6730     6730           
=======================================
+ Hits        19121    19125    +4     
  Misses      19994    19994           
  Partials      718      718           
Flag Coverage Δ
provider-base 24.73% <93.75%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@tomli380576 tomli380576 marked this pull request as ready for review November 8, 2024 08:25
@tomli380576 tomli380576 changed the title Fixing type errors in prime_offload_tester.py (Bugfix) Fixing index & type errors in prime_offload_tester.py (Bugfix) Nov 14, 2024
@tomli380576 tomli380576 removed the request for review from fernando79513 November 22, 2024 02:59
@Hook25 Hook25 self-assigned this Nov 22, 2024
Copy link
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

LGTM

@Hook25 Hook25 merged commit a0a37e3 into main Nov 22, 2024
53 checks passed
@Hook25 Hook25 deleted the prime-offload-type-err branch November 22, 2024 15:21
eugene-yujinwu pushed a commit to eugene-yujinwu/checkbox that referenced this pull request Dec 31, 2024
…ical#1588)

* fix: make annotations compatible with py 3.5

* fix: non-null assertions, comments

* fix: root check

* fix: only the letter 'g' was used in offloading to specific gpu test

* style: less brackets

* fix: update unit tests to reflect the changes
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.

2 participants