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

chore: skip test_cpu_freq on macOS arm64 #2146

Merged
merged 1 commit into from
Oct 18, 2022

Conversation

mayeut
Copy link
Contributor

@mayeut mayeut commented Sep 25, 2022

Summary

  • OS: macOS
  • Bug fix: no
  • Type: tests
  • Fixes:

Description

macOS arm64 does not support cpu_freq: issue #1892

Signed-off-by: mayeut mayeut@users.noreply.github.com

@mayeut mayeut force-pushed the macos-arm64-cpu-freq-failure branch 3 times, most recently from 3216d5e to 1542e1c Compare September 25, 2022 11:02
@mayeut mayeut force-pushed the macos-arm64-cpu-freq-failure branch from 1542e1c to 18ebd4d Compare October 6, 2022 20:17
@mayeut mayeut force-pushed the macos-arm64-cpu-freq-failure branch from 18ebd4d to ea600b3 Compare October 8, 2022 09:21
@@ -130,6 +131,7 @@
CI_TESTING = APPVEYOR or GITHUB_ACTIONS
# are we a 64 bit process?
IS_64BIT = sys.maxsize > 2 ** 32
MACOS_ARM64 = MACOS and platform.machine() == 'arm64'
Copy link
Owner

Choose a reason for hiding this comment

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

I would define this as a generic ARM64 instead of making it specific for macOS.
Regardless, since it's only being used once across the entire code base, I think you can simply use platform.machine() later, in the test itself.

return unittest.expectedFailure(func)
else:
return func
return wrapper
Copy link
Owner

Choose a reason for hiding this comment

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

No need for this in my opinion.

@@ -144,6 +146,7 @@ def test_cpu_count_cores(self):
num = sysctl("sysctl hw.physicalcpu")
self.assertEqual(num, psutil.cpu_count(logical=False))

@expectedFailureIf(MACOS_ARM64) # macOS arm64 not supported: issue #1892
Copy link
Owner

Choose a reason for hiding this comment

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

See my comment above: there's no need of an additional decorator. Please define this as:

# TODO: remove this once 1892 is fixed
@unittes.skipIf(MACOS and platform.machine() == 'arm64', "skipped due to #1892")
def test_cpu_freq(self):
    ...

@giampaolo
Copy link
Owner

If this is still valid, there are some comments I added that should be addressed.

macOS arm64 does not support cpu_freq: issue giampaolo#1892

Signed-off-by: mayeut <mayeut@users.noreply.github.com>
@mayeut mayeut force-pushed the macos-arm64-cpu-freq-failure branch from ea600b3 to 66fa586 Compare October 18, 2022 20:15
@mayeut mayeut changed the title chore: mark test_cpu_freq as expected failure on macOS arm64 chore: skip test_cpu_freq on macOS arm64 Oct 18, 2022
@giampaolo giampaolo merged commit 1da9f79 into giampaolo:master Oct 18, 2022
mayeut added a commit to mayeut/psutil that referenced this pull request Oct 18, 2022
Signed-off-by: mayeut <mayeut@users.noreply.github.com>
giampaolo pushed a commit that referenced this pull request Oct 18, 2022
Signed-off-by: mayeut <mayeut@users.noreply.github.com>
ddelange added a commit to ddelange/psutil that referenced this pull request Oct 28, 2022
* 'master' of https://github.com/giampaolo/psutil:
  add windows test for free physical mem giampaolo#2074
  fix OSX tests broken by accident
  update HISTORY + give CREDITS for @arossert, @smoofra, @mayeut for giampaolo#2102, giampaolo#2156, giampaolo#2010
  build fix for Mac OS, Apple Silicon (giampaolo#2010)
  Linux: fix missing SPEED_UNKNOWN definition (giampaolo#2156)
  Use system-level values for Windows virtual memory (giampaolo#2077)
  feature: use ABI3 for cp36+ (giampaolo#2102)
  fix py2 compatibility
  improve API speed benchmark script giampaolo#2102
  fix: linter issues from giampaolo#2146 (giampaolo#2155)
  chore: skip test_cpu_freq on macOS arm64 (giampaolo#2146)
  pre-release + give CREDITS to @mayeut (PR giampaolo#2040) and @eallrich (new supporter)
  Fix a typo (giampaolo#2047)
  move isort and coverage config into pyproject.toml
  fix giampaolo#2021, fix giampaolo#1954, provide OSX arm64 bins + add pyproject.toml (giampaolo#2040)
  refactor git_log.py
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.

None yet

2 participants