Skip to content

Feat/12053 binary search v3#6

Open
Davihan11 wants to merge 14 commits into
CESNET:mainfrom
Davihan11:feat/12053-binary-search-v3
Open

Feat/12053 binary search v3#6
Davihan11 wants to merge 14 commits into
CESNET:mainfrom
Davihan11:feat/12053-binary-search-v3

Conversation

@Davihan11

Copy link
Copy Markdown
Collaborator

Added binary search algorithm

Added binary search algorithm for more automatic way of searching maximum allowed multiplier for any given test. These changes also included more refactoring of test.py files.

Changes

  • util/search_util.py - Added file with binary search logic and also a test function
  • util/suri_util.py - Added function that returns the latest run drop rate
  • conftest.py - Added definitions and fixtures for binary search parameters
  • pytest_start.sh - Added parameters, default values and parsing for binary search parameters, also few formatting changes for better readability
  • tests/*/test_*_simple.py - Extracted testing code to a class, allowing for easy passing of the run functions into futher codebase

@Davihan11 Davihan11 requested a review from lukashino June 29, 2026 08:04
@Davihan11 Davihan11 self-assigned this Jun 29, 2026
Comment thread tests/trex_one_port/test_trex_one_port.py
Comment thread tests/trex_one_port/test_trex_one_port.py
@Davihan11

Davihan11 commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

Look if it is possible to extract Test_run class to a seperate file to remove duplicates? Opinion wanted

Comment thread util/search_util.py
Comment thread util/search_util.py
@lukashino

Copy link
Copy Markdown
Collaborator

@Davihan11 After the merge of @matyas7dub work, a more severe rebase will be needed.

@lukashino

Copy link
Copy Markdown
Collaborator

I also requested Copilot's review. You can evaluate its feedback as necessary; do not take it as "a must". Reject/comment on it if irrelevant.

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces an automated binary-search mode to find the maximum throughput multiplier that stays under a target drop-rate, wiring it into the test harness via new CLI/pytest options and refactoring several tests to use a callable “runner” object.

Changes:

  • Add util/search_util.py with the binary search loop that repeatedly runs a test and evaluates drop rate.
  • Add get_drop_rate() in util/suri_util.py to compute drop rate from the latest results/artefacts/**/aggregated.json.
  • Add pytest options/fixtures (conftest.py) and script args (pytest_start.sh) to configure binary-search parameters; refactor multiple tests to support binary-search execution.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
util/suri_util.py Adds get_drop_rate() that derives drop rate from the latest aggregated results.
util/search_util.py Introduces binary search driver and evaluation function used by tests.
conftest.py Adds CLI options and fixtures for binary-search parameters.
pytest_start.sh Adds shell argument parsing and forwards binary-search args to pytest.
tests/trex_one_port/test_trex_one_port.py Adds binary-search mode and refactors run logic into a helper class.
tests/nfs_smb_simple/test_nfs_smb_simple.py Same refactor + binary-search integration.
tests/https_simple/test_https_simple.py Same refactor + binary-search integration.
tests/http_simple/test_http_simple.py Same refactor + binary-search integration.
tests/http_https_smb_simple/test_http_https_smb_simple.py Same refactor + binary-search integration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread util/suri_util.py
Comment thread util/search_util.py
Comment thread pytest_start.sh
Comment thread conftest.py
Comment thread conftest.py
Comment thread tests/trex_one_port/test_trex_one_port.py
Comment thread tests/http_simple/test_http_simple.py
Comment thread tests/https_simple/test_https_simple.py
Comment thread tests/nfs_smb_simple/test_nfs_smb_simple.py
Comment thread tests/http_https_smb_simple/test_http_https_smb_simple.py
@lukashino

Copy link
Copy Markdown
Collaborator

Look if it is possible to extract Test_run class to a seperate file to remove duplicates? Opinion wanted

Can you highlight the duplicates? Or perhaps the recent @matyas7dub work addressed that?

@Davihan11

Copy link
Copy Markdown
Collaborator Author

Look if it is possible to extract Test_run class to a seperate file to remove duplicates? Opinion wanted

Can you highlight the duplicates? Or perhaps the recent @matyas7dub work addressed that?

I am talking about the class Test_run, where I have 4 of them with the only difference between them being the profile creation.

@matyas7dub

Copy link
Copy Markdown
Collaborator

Look if it is possible to extract Test_run class to a seperate file to remove duplicates? Opinion wanted

Can you highlight the duplicates? Or perhaps the recent @matyas7dub work addressed that?

I am talking about the class Test_run, where I have 4 of them with the only difference between them being the profile creation.

One approach could be through python subclasses (similar to how trex_client_manager.py defines BaseTrexClientManager which then gets subclassed in the individual profiles) or you could look into somehow generating the tests from the TRex profiles directly inside conftest.py, since they are mostly differing only in TRex instantiation on main as well.

@Davihan11

Copy link
Copy Markdown
Collaborator Author

Look if it is possible to extract Test_run class to a seperate file to remove duplicates? Opinion wanted

Can you highlight the duplicates? Or perhaps the recent @matyas7dub work addressed that?

I am talking about the class Test_run, where I have 4 of them with the only difference between them being the profile creation.

One approach could be through python subclasses (similar to how trex_client_manager.py defines BaseTrexClientManager which then gets subclassed in the individual profiles) or you could look into somehow generating the tests from the TRex profiles directly inside conftest.py, since they are mostly differing only in TRex instantiation on main as well.

If I recall when we were discussing test_settings.json, I recall that we decided that the tests should be independent of each other. For that reason, I will not be putting them together.

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.

4 participants