Skip to content

[minigraph-parser] Update UT to avoid race condition during build image#18321

Merged
yxieca merged 1 commit intosonic-net:masterfrom
lizhijianrd:update-minigraph-testcase
Mar 12, 2024
Merged

[minigraph-parser] Update UT to avoid race condition during build image#18321
yxieca merged 1 commit intosonic-net:masterfrom
lizhijianrd:update-minigraph-testcase

Conversation

@lizhijianrd
Copy link
Contributor

@lizhijianrd lizhijianrd commented Mar 11, 2024

Why I did it

Fix issue #18180.
I suspect this issue caused by race condition during building SONiC image. Some UT cases of minigraph-parser missed port_config_path. Hence the testcases will rely on method device_info.get_path_to_port_config_file in sonic-py-common to read port config info. As multiple components in SONiC are built in parallel, that method may not finish built when it's called by UT.

Work item tracking
  • Microsoft ADO (number only): 27109878

How I did it

Transfer value to param port_config_path when calling function parse_xml in UT. Then the UT will not rely on sonic-py-common.

How to verify it

Verified by PR test.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202311

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@lizhijianrd lizhijianrd changed the title [minigraph-parser] Add [minigraph-parser] Update UT to avoid race condition during build image Mar 11, 2024
@lizhijianrd
Copy link
Contributor Author

Hi @yxieca , can you please help to merge this PR?

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #18346

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants