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

[Serverless] Fix flaky tests #11368

Merged
merged 2 commits into from
Mar 21, 2022
Merged

[Serverless] Fix flaky tests #11368

merged 2 commits into from
Mar 21, 2022

Conversation

maxday
Copy link
Contributor

@maxday maxday commented Mar 18, 2022

What does this PR do?

Tests related to Daemon/Lifecycle have been marked as flaky by datadog-ci
Those were not failing the CI as we retry 5 times each tests but this PR should fix them once for all :)

The flakiness came from:

  1. fixed port in tests can have unpredictable behaviour in CI where a lot of tests are running, we may not control which port has been already taken or not
  2. since ListenAndServe is started in its own go routine (see : https://github.com/DataDog/datadog-agent/blob/main/pkg/serverless/daemon/daemon.go#L126), it's possible that StartDaemon returns before actually being able to server /lambda/* endpoints

Screen Shot 2022-03-18 at 3 44 15 PM

This problem is not actually an issue outside of tests since we start the daemon way before starting accepting invocation but it might be good to think about a more robust approach in the future

Additional Notes

Failure rate was quite high (more than 10%) and I was unable to reproduce a failure with this fix after running the tests 200 times.

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the config template has been updated.

@maxday maxday added this to the Triage milestone Mar 18, 2022
@maxday maxday requested a review from a team as a code owner March 18, 2022 19:42
Copy link
Contributor

@nhinsch nhinsch left a comment

Choose a reason for hiding this comment

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

🙏 Thanks for fixing!

@maxday maxday merged commit 304c66a into main Mar 21, 2022
@maxday maxday deleted the maxday/fix-flaky-tests branch March 21, 2022 21:00
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.

None yet

2 participants