Skip to content

Recreate topology on previous test failure and run setup_teardown fixture once per test method#297

Open
zikkend wants to merge 2 commits into
opencomputeproject:mainfrom
zikkend:change_ptf_behavior_on_failure
Open

Recreate topology on previous test failure and run setup_teardown fixture once per test method#297
zikkend wants to merge 2 commits into
opencomputeproject:mainfrom
zikkend:change_ptf_behavior_on_failure

Conversation

@zikkend

@zikkend zikkend commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Old behavior

When a test failed, the NPU was reset without recreating the topology, causing all subsequent tests to fail. In addition, the test class setup_teardown fixture was executed only once per test class. If a test method within the class failed, the fixture was not run again, leaving the test environment in an inconsistent state and causing subsequent test methods in the same class to fail.

New behavior

When a test fails, the NPU is reset and the topology is recreated before the next test is executed. Additionally, the test class setup_teardown fixture is now executed once per test method instead of once per test class

As a result, tests are isolated from failures in previous test methods. However, the overall test execution time increases because setup_teardown is invoked for every test method

Comment thread tests/test_fdb.py Outdated
Comment thread tests/test_vlan.py Outdated
@zikkend zikkend force-pushed the change_ptf_behavior_on_failure branch from 158777e to affe1bc Compare June 19, 2026 09:29
zikkend added 2 commits June 19, 2026 15:30
…ture once per test method

Signed-off-by: Denys Zikratyi <denys.zikratyi@gmail.com>
Signed-off-by: Denys Zikratyi <denys.zikratyi@gmail.com>
@zikkend zikkend force-pushed the change_ptf_behavior_on_failure branch from affe1bc to 8d8378b Compare June 19, 2026 12:30
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.

2 participants