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

[Bug]: test_ecmp_hash_seed_value test fails with IndexError #14829

Closed
dayouliu1 opened this issue Oct 2, 2024 · 4 comments · Fixed by #14830
Closed

[Bug]: test_ecmp_hash_seed_value test fails with IndexError #14829

dayouliu1 opened this issue Oct 2, 2024 · 4 comments · Fixed by #14830

Comments

@dayouliu1
Copy link
Contributor

dayouliu1 commented Oct 2, 2024

Issue Description

test_ecmp_hash_seed_value will fail when loading the check_dut_asic_type fixture

Results you see

test_ecmp_hash_seed_value will fail on setup with IndexError: Bad index 'None' type <class 'NoneType'> when loading check_dut_asic_type fixture

Results you expected to see

Expect to see no failure

Is it platform specific

generic

Relevant log output

failed on setup with "IndexError: Bad index 'None' type <class 'NoneType'>"
==========================
request = <SubRequest 'check_dut_asic_type' for <Function test_ecmp_hash_seed_value[dut]>>
duthosts = [<MultiAsicSonicHost dut>], rand_one_dut_hostname = None

    @pytest.fixture(scope="function")
    def check_dut_asic_type(request, duthosts, rand_one_dut_hostname):
>       duthost = duthosts[rand_one_dut_hostname]

duthosts   = [<dut>]
rand_one_dut_hostname = None
request    = <SubRequest 'check_dut_asic_type' for <Function test_ecmp_hash_seed_value[dut]>>

common/plugins/custom_fixtures/check_dut_asic_type.py:7:

Output of show version

202405

Attach files (if any)

No response

@ZhaohuiS
Copy link
Contributor

it's fixed by #14935 (comment)

#14075 was forgot to do cherry pick into 202405

@dayouliu1
Copy link
Contributor Author

I see that #14935 changed the fixture dependencies in check_dut_asic_type, but the underlying problem is still present and will pop up again if there is another instance where rand_one_dut_hostname or selected_rand_dut is added dynamically.

@ZhaohuiS
Copy link
Contributor

@dayouliu1 would you please come up a fix PR?

@dayouliu1
Copy link
Contributor Author

This is the fix: #14830

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 a pull request may close this issue.

2 participants