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

[eventd] Fix eventd UT flakiness #17055

Merged
merged 17 commits into from
Feb 13, 2024
Merged

Conversation

zbud-msft
Copy link
Contributor

@zbud-msft zbud-msft commented Oct 31, 2023

Why I did it

Fix flakiness of eventd UT - run sub after capture service starts

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

How I did it

Run sub socket after capture socket is initialized

How to verify it

Pipeline

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

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

Tested branch (Please provide the tested image version)

  • 20230531.15

Description for the changelog

Link to config_db schema for YANG module changes

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

@zbud-msft
Copy link
Contributor Author

/azpw ms_conflict

1 similar comment
@zbud-msft
Copy link
Contributor Author

/azpw ms_conflict

@zbud-msft
Copy link
Contributor Author

@StormLiangMS Can you please review? I have tested this issue on official build pipeline and I am no longer seeing any flakiness in 12+ consecutive runs.

@@ -625,7 +632,7 @@ TEST(eventd, service)
run_pub(mock_pub, wr_source, wr_evts);

/* Published events must have been captured. Give a pause, to ensure sent. */
this_thread::sleep_for(chrono::milliseconds(200));
this_thread::sleep_for(chrono::milliseconds(1000));
Copy link
Collaborator

@qiluo-msft qiluo-msft Dec 2, 2023

Choose a reason for hiding this comment

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

1000

Is this a critical fix? How do you pick the magic number? Is it possible to wait for a stable signal? #Closed

Copy link
Contributor

Choose a reason for hiding this comment

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

ZMQ is async. No signal indication. It silently drops when not good.


while(true) {
auto current_ts = chrono::steady_clock::now();
if(chrono::duration_cast<chrono::milliseconds>(current_ts - poll_start_ts).count() >= max_polling_duration) {
Copy link
Collaborator

@qiluo-msft qiluo-msft Jan 31, 2024

Choose a reason for hiding this comment

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

   [](http://example.com/codeflow?start=0&length=5)

Mix using tabs (several lines in the new code) and spaces. #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

qiluo-msft
qiluo-msft previously approved these changes Jan 31, 2024
@qiluo-msft qiluo-msft merged commit ff5efe8 into sonic-net:master Feb 13, 2024
19 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Feb 16, 2024
### Why I did it

Fix flakiness of eventd UT - run sub after capture service starts

##### Work item tracking
- Microsoft ADO **(number only)**:25650744

#### How I did it

Run sub socket after capture socket is initialized

#### How to verify it

Pipeline
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #18111

mssonicbld pushed a commit that referenced this pull request Feb 19, 2024
### Why I did it

Fix flakiness of eventd UT - run sub after capture service starts

##### Work item tracking
- Microsoft ADO **(number only)**:25650744

#### How I did it

Run sub socket after capture socket is initialized

#### How to verify it

Pipeline
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Mar 4, 2024
### Why I did it

Fix flakiness of eventd UT - run sub after capture service starts

##### Work item tracking
- Microsoft ADO **(number only)**:25650744

#### How I did it

Run sub socket after capture socket is initialized

#### How to verify it

Pipeline
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #18249

mssonicbld pushed a commit that referenced this pull request Mar 4, 2024
### Why I did it

Fix flakiness of eventd UT - run sub after capture service starts

##### Work item tracking
- Microsoft ADO **(number only)**:25650744

#### How I did it

Run sub socket after capture socket is initialized

#### How to verify it

Pipeline
sonic-otn pushed a commit to Weitang-Zheng/sonic-buildimage that referenced this pull request Mar 11, 2024
### Why I did it

Fix flakiness of eventd UT - run sub after capture service starts

##### Work item tracking
- Microsoft ADO **(number only)**:25650744

#### How I did it

Run sub socket after capture socket is initialized

#### How to verify it

Pipeline
saksarav-nokia pushed a commit to saksarav-nokia/sonic-buildimage that referenced this pull request Mar 12, 2024
### Why I did it

Fix flakiness of eventd UT - run sub after capture service starts

##### Work item tracking
- Microsoft ADO **(number only)**:25650744

#### How I did it

Run sub socket after capture socket is initialized

#### How to verify it

Pipeline
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.

8 participants