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

test_105_network_plugin_method fails on aarch64-linux #3040

Closed
gador opened this issue Dec 3, 2024 · 6 comments
Closed

test_105_network_plugin_method fails on aarch64-linux #3040

gador opened this issue Dec 3, 2024 · 6 comments

Comments

@gador
Copy link

gador commented Dec 3, 2024

Describe the bug
When trying to compile the current glances version for aarch64-linux it fails. This happens since version 4.2.0

To Reproduce
Steps to reproduce the behavior:

  1. Compile glances version 4.2.0 from source for aarch64-linux
  2. See the error:
glances-aarch64-linux> ======================================================================
glances-aarch64-linux> ERROR: test_105_network_plugin_method (__main__.TestGlances.test_105_network_plugin_method)
glances-aarch64-linux> Test network plugin methods
glances-aarch64-linux> ----------------------------------------------------------------------
glances-aarch64-linux> Traceback (most recent call last):
glances-aarch64-linux>   File "/build/source/unittest-core.py", line 720, in test_105_network_plugin_method
glances-aarch64-linux>     self._common_plugin_tests('network')
glances-aarch64-linux>   File "/build/source/unittest-core.py", line 246, in _common_plugin_tests
glances-aarch64-linux>     first_history_field = self.chk_hist_maybe_add_third_elem(plugin_instance)
glances-aarch64-linux>                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
glances-aarch64-linux>   File "/build/source/unittest-core.py", line 200, in chk_hist_maybe_add_third_elem
glances-aarch64-linux>     first_history_field = self.get_first_history_field(plugin_instance)
glances-aarch64-linux>                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
glances-aarch64-linux>   File "/build/source/unittest-core.py", line 182, in get_first_history_field
glances-aarch64-linux>     return first_history_field
glances-aarch64-linux>            ^^^^^^^^^^^^^^^^^^^
glances-aarch64-linux> UnboundLocalError: cannot access local variable 'first_history_field' where it is not associated with a value
glances-aarch64-linux>
glances-aarch64-linux> ----------------------------------------------------------------------
glances-aarch64-linux> Ran 37 tests in 8.678s
glances-aarch64-linux>
glances-aarch64-linux> FAILED (errors=1)

Expected behavior
All tests to pass

Environement (please complete the following information)

  • Operating System (lsb_release -a or OS name/version): NixOS unstable 25.04
  • Glances & psutil versions: 4.2.0
  • How do you install Glances (Pypi package, script, package manager, source): nix
  • Glances test (only available with Glances 3.1.7 or higher): Unable

Additional context

For anyone to try on a nix-enabled system:
nix build --system "aarch64-linux" github:nixos/nixpkgs/ccaf4694a0ea752e33d70942d9ee06a18c3da805#glances

@nicolargo
Copy link
Owner

nicolargo commented Dec 8, 2024

The PR 98e8e32 breaks this test.

@ariel-anieli Can you have a look on it ?

@nicolargo nicolargo added this to the Glances 4.3.0 milestone Dec 8, 2024
@ariel-anieli
Copy link
Contributor

The PR 98e8e32 breaks this test.

@ariel-anieli Can you have a look on it ?

Sure, @nicolargo.

@gador, for me to understand: you used this command; and got back the error you showed before. Is that right?

nix build --system "aarch64-linux" github:nixos/nixpkgs/ccaf4694a0ea752e33d70942d9ee06a18c3da805#glances

@gador
Copy link
Author

gador commented Dec 8, 2024

@gador, for me to understand: you used this command; and got back the error you showed before. Is that right?


nix build --system "aarch64-linux" github:nixos/nixpkgs/ccaf4694a0ea752e33d70942d9ee06a18c3da805#glances

Yes, correct. This just pins the commit I used and accounts for the system. I suspect the error will also show without using nix when compiling glances on aarch64-linux

@ariel-anieli
Copy link
Contributor

@nicolargo, #3045 reverts 98e8e32.
I will redo the refactor.

@ariel-anieli
Copy link
Contributor

For me to have a reference, @gador: before that commit, the test passed. Is this right?
On my computer, after revert (which is also, before the commit I introduced), all tests are passing:

# make test-core | grep -P '^ok|^fail'
.....................................
----------------------------------------------------------------------
Ran 37 tests in 7.635s

OK

@gador
Copy link
Author

gador commented Dec 8, 2024

@ariel-anieli yes, this fixes the issue (yay!)

For anyone to try, this is my fork of nixpkgs from the above commit with the patch applied:

nix build --system "aarch64-linux" github:gador/nixpkgs/8923dfa16cff4e5436641c7b3bdbf94669a7157a#glances

(NixOS/nixpkgs@8923dfa)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants