Closed korjaa closed 5 years ago
Found a nice icetea patch from @kuggenhoffen :)
Don't merge yet, I'll add one more fix for catching last bytes if DUT dies quickly.
That should do it.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
icetea_lib/GenericProcess.py | 0 | 8 | 0.0% | ||
<!-- | Total: | 0 | 8 | 0.0% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
icetea_lib/GenericProcess.py | 1 | 16.0% | ||
<!-- | Total: | 1 | --> |
Totals | |
---|---|
Change from base Build 760: | -0.03% |
Covered Lines: | 4998 |
Relevant Lines: | 7088 |
@korjaa It would be good idea to test if the same issue happens in OS X with the kQueue implementation as well.
@korjaa are you going to test as @kuggenhoffen suggested or should I merge this?
This can be used to verify if that this patch works.
import time
from icetea_lib.bench import Bench
from icetea_lib.bench import TestStepFail
class Testcase(Bench):
def __init__(self):
Bench.__init__(
self,
name="verify_quick_exit",
type="smoke",
requirements={
"duts": {
'*': {
"count": 1,
"type": "process"
},
1: {
"application": {
"bin": "/bin/echo",
"bin_args": ["If this is found, the test passed"],
"init_cli_cmds": [],
"post_cli_cmds": []
}
}
}
}
)
def setup(self):
pass
def case(self):
time_start = time.time()
result = False
while (time.time() - time_start) < 10.0 and result == False:
result = self.verify_trace(0, "If this is found, the test passed", False)
time.sleep(1.0)
if result == False:
raise TestStepFail("Didn't get trace")
def teardown(self):
pass
@SeppoTakalo could you check the above testcase, I don't have OS X with kQueue. If ran against master, it should FAIL. If ran against this PR, it should PASS.
Any news on this? @korjaa @SeppoTakalo
~Even with these changes, I've seen couple of times traces been lost.~ Noticed my icetea had falled back to old version, cannot reproduce the issue anymore with the latest version.
I'm pushing this backwards so I can make the v1.1.1 release today hopefully.
@jupe Any chance you could test this on Mac?
I can merge this if I'm given the ok.
New included test_genericprocess.py
test can be executed with
coverage run -m unittest discover -s test -p test_genericprocess.py
Fixing unittests, windows returning some weird return code.
Rebased and squashed.
ci/circleci: test-3.5
is broken at the moment
Status
WORK-IN-PROGRESS
Migrations
NO
Description
Even if pipe is closed and it sets state to error the readline should read all the already received and queued lines. Otherwise in some cases last traces / output from process is lost.
Related PRs
-
Todos
Deploy Notes
-
Steps to Test or Reproduce
Outline the steps to test or reproduce the PR here.
Impacted Areas in Application
List components, applications or use-cases that this PR will affect: