Skip to content

Conversation

@zyronix
Copy link
Collaborator

@zyronix zyronix commented May 20, 2025

When running with multiple --add commands, the code could cause the run in a never ending loop. Solved this by keeping track of what was already ran.

@zyronix zyronix requested review from Wineh and Copilot May 20, 2025 08:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a never ending loop bug when using multiple --add commands by tracking already executed operations. Key changes include:

  • Adding the pytest-timeout dependency in tox.ini.
  • Updating test expectations and adding a new test case to ensure the loop fix works correctly.
  • Preparing the testdata for the new infinite loop test in conftest.py.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tox.ini Added pytest-timeout dependency to support timeout testing.
tests/test_app.py Updated expected line counts and added a new test for loop detection.
tests/conftest.py Created test input file for the infinite loop test.
Comments suppressed due to low confidence (2)

tests/test_app.py:987

  • [nitpick] The addition of a timeout test for the infinite loop is a good safety measure. Consider expanding test cases to cover other combinations of --add commands if applicable.
@mark.timeout(1)

tests/test_app.py:191

  • The expected line count was updated from 29 to 21. Please confirm that this change accurately reflects the intended fix for the never ending loop.
assert line_num_output == 21

"""
results = []
log = []
processed_lines = set()
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the unique qualities of set

@Wineh
Copy link
Contributor

Wineh commented May 20, 2025

Tested with 600MB wordlist: ✔️
Tested with a small file which would otherwise cause a loop: ✔️

@zyronix zyronix merged commit 9804cc2 into master May 20, 2025
4 checks passed
@zyronix zyronix deleted the bug/never_ending_loop branch May 20, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants