Fix log/syslog not being correct when last test fails for given module #1395
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.
What/Why I did:-
As reported by this issue PR#box/flaky#128
and PR#pytest-dev/pytest-rerunfailures#51
currently pytest will call session/module tear-down before flaky
can retry the test when last test case fails. And Session/Module will be setup again to run last test
retry.
Because of above behaviour when last test fail for given module
all the logs are lost for all test-case upto that point since when
tear down is called dvs container is destroyed and to run retry instance
DVS container is setup up again and logs only belonging to this instance
of run are captured and overwrite all previous logs.
Workaround to have default dummy pass (as suggested in above Issue also) test case at end always so we
avoid module tear-down and setup again and logs are not lost.