-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fixes: 17292 - Detect infinite loop condition while iterating terminations in CablePath.from_origin #17293
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
Closed
Closed
Fixes: 17292 - Detect infinite loop condition while iterating terminations in CablePath.from_origin #17293
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3aaf5bb
Detect infinite loop condition while iterating terminations in CableP…
bctiemann b027ff8
Add unit test for infinite loop detection
bctiemann 11237c6
Merge remote-tracking branch 'origin/develop' into 17292-detect-infin…
bctiemann 92a96a3
More elegant and comprehensive way to detect if a cable is already in…
bctiemann 6a42ca3
Add max_length param to from_origin to support testing
bctiemann cdf7aa1
Test from_origin directly
bctiemann bfe6d39
Move CABLE_TRACE_MAX_LENGTH to settings
bctiemann 4626649
Remove max_length from signals/outer functions
bctiemann 19076fe
Cleanup
bctiemann b8545d2
Merge branch 'develop' into 17292-detect-infinite-loop-in-cable-trace
bctiemann 0d75210
Merge branch 'develop' into 17292-detect-infinite-loop-in-cable-trace
bctiemann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Is this test suppose to fail or succeed? As it stands I don't see a loop in the topology unless I am missing something.
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.
If there's an infinite loop then the test will just keep executing. I'm not sure of an elegant way to test the infinite looping condition, but as long as it executes without the whole test process hanging then the test passes.
I've tried a few different approaches for making it assert if the execution takes too long or loops too many times, mostly involving timeouts and/or threading, but I don't know if it's worth going to that extreme. What would you suggest?
In any case if you comment out lines 600-602 in cables.py, the test will hang indefinitely.
Uh oh!
There was an error while loading. Please reload this page.
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.
IMO, for testing purposes we may want to add a parameter that sets a maximum path length (might not be bad anyways to set it to an unreasonable number) and still create a loop.
IDK if it is worth it though TBH. It is just this test doesn't really do anything as far as testing for a "loop" though., which was more my point. Might not be worth including a test even for this.