One specific case fails: True (insert the background thread for profiling), False (don't remove the main thread).
Looking into the test failure a bit, it appears that the code object from the background thread does not get emitted, giving in the results: '<unknown code>': 1.
Furthermore, if we omit the code object filtering here (just this one line, i.e. emit all code objects) then the test passes. The only thing it seems it could be is if the code object is not getting included in the seen_code_objects. Perhaps the output file needs to be flushed before reading it back in to determine the set of seen addresses?
After further investigation, this particular test failure appears to be due to interruption of sleep by the SIGALRM triggered during real_time profiling (#204). Closing this.
Suspect a known issue, since the test is marked
xfail
: https://github.com/vmprof/vmprof-python/blob/master/vmprof/test/test_run.py#L258-L280. But I didn't see a GitHub issue, so documenting my understanding of the problem here.One specific case fails: True (insert the background thread for profiling), False (don't remove the main thread).
Looking into the test failure a bit, it appears that the code object from the background thread does not get emitted, giving in the results:
'<unknown code>': 1
.Furthermore, if we omit the code object filtering here (just this one line, i.e. emit all code objects) then the test passes. The only thing it seems it could be is if the code object is not getting included in the
seen_code_objects
. Perhaps the output file needs to be flushed before reading it back in to determine the set of seen addresses?