-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
EC2: Eni detach error #7697
EC2: Eni detach error #7697
Conversation
@bblommers I skipped the new test in server mode as it was failing and I couldn't repro locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ServerMode error can be reproduced by running the tests in parallel:
MOTO_CALL_RESET_API=false TEST_SERVER_MODE=true pytest -sv tests/test_ec2/test_elastic_network_interfaces.py -n 4
The reason it fails is because there will be other ENI's present (created by other tests) - so the len(enis)
will always be greater than 0.
I think the logic should be changed so that we check the number of ENI's on that specific instance:
for eni ..:
if eni.attachment_id..:
if len(eni.instance.nics) ==1:
raise LastEniDetachError
detach_eni..
728ad80
to
0f85a02
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7697 +/- ##
=======================================
Coverage 94.33% 94.33%
=======================================
Files 1087 1087
Lines 92757 92765 +8
=======================================
+ Hits 87500 87508 +8
Misses 5257 5257
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great - thank you @rafcio19!
This is now part of moto >= 5.0.8.dev11 |
Resolves #7678