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

fix(tests): make sure multiple e2e tests run concurrently #1861

Merged
merged 11 commits into from
Jan 30, 2023
Merged

Conversation

rubenfonseca
Copy link
Contributor

@rubenfonseca rubenfonseca commented Jan 25, 2023

Issue number: #1860

Summary

Changes

Please provide a summary of what's being changed

Fix E2E tests by marking all tests in the same folder with the same xdist_group.

User experience

Please share what the user experience looks like before and after this change

Before this change, tests would randomly fail, as a test would try to use infrastructure that was already being teared down.
With this change, all related tests are scheduled together, thus avoiding the problem.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@boring-cyborg boring-cyborg bot added the tests label Jan 25, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 25, 2023
@rubenfonseca rubenfonseca changed the title fix: make sure multiple e2e tests run concurrently fix(e2e): make sure multiple e2e tests run concurrently Jan 25, 2023
@github-actions github-actions bot added the bug Something isn't working label Jan 25, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2023

Codecov Report

Base: 97.51% // Head: 97.51% // No change to project coverage 👍

Coverage data is based on head (2bfc558) compared to base (a556d28).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1861   +/-   ##
========================================
  Coverage    97.51%   97.51%           
========================================
  Files          143      143           
  Lines         6570     6570           
  Branches       466      466           
========================================
  Hits          6407     6407           
  Misses         128      128           
  Partials        35       35           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@boring-cyborg boring-cyborg bot added the github-actions Pull requests that update Github_actions code label Jan 27, 2023
@rubenfonseca rubenfonseca marked this pull request as ready for review January 27, 2023 12:52
@rubenfonseca rubenfonseca requested a review from a team as a code owner January 27, 2023 12:52
@rubenfonseca rubenfonseca requested review from heitorlessa and removed request for a team January 27, 2023 12:52
Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

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

great work!! Some questions so I can become familiar with certain decisions.

tests/e2e/conftest.py Outdated Show resolved Hide resolved
tests/e2e/event_handler/conftest.py Show resolved Hide resolved
tests/e2e/parameters/infrastructure.py Show resolved Hide resolved
tests/e2e/utils/functions.py Outdated Show resolved Hide resolved
running_tasks: List[Future] = []
for arn in lambdas_arn:
# Sleep 0.5, 1, 1.5, ... seconds between each invocation. This way
# we can guarantee that lambdas are executed in parallel, but they are
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I follow - how will they be called in parallel if you're adding them to the executor within a 0.5s interval? What was the issue before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use case: we want to fire two lambdas at the same time for the idempotency test. Each Lambda will block for 3 seconds. We want the first lambda to block for 3 seconds, and the second Lambda to throw with "execution is already running".

Before this change, both Lambdas will be fired at the same time, and due to networking jitter and other factors, we couldn't assume the order that they will actually be run. So in this case we guarantee that, while they will be called in parallel, each successive invocation will be slightly shifted in time to make sure we guarantee the output order. Does this make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

It does - thank you!!

For the future (not in this PR), I'd suggest renaming or having a parameter for that purpose so we don't accidentally use it for another use case that might incur side effects in assertion (e.g., execution finishing fast enough).

@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 27, 2023
@rubenfonseca
Copy link
Contributor Author

@heitorlessa addressed your questions and refactored some code, please let me know your thoughts

@boring-cyborg boring-cyborg bot added the dependencies Pull requests that update a dependency file label Jan 30, 2023
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 30, 2023
@rubenfonseca rubenfonseca changed the title fix(e2e): make sure multiple e2e tests run concurrently fix(tests): make sure multiple e2e tests run concurrently Jan 30, 2023
@rubenfonseca rubenfonseca merged commit 3780a95 into develop Jan 30, 2023
@rubenfonseca rubenfonseca deleted the fix/e2e branch January 30, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file github-actions Pull requests that update Github_actions code size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: E2E tests are currently not working
3 participants