robotframework / robotframework/robotframework
Using python multiprocessing lib and logger from robot.api corrupts output.xml' file.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 11.9k
- Forks
- 2.6k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 10
Description
Robot versions: 7.0.1
Python 3.11
Amazon Linux image used
I have tests where I'm using python multiprocessing library. When I'm running them on AWS linux machine I'm getting an error "output.xml' failed: Incompatible child element 'arg' for 'test'". But when I'm running them locally in my MacOS environment everything is ok.
This issue occurs upon using logger from robot framework api lib. When two different process are trying to log some data, output.xml file gets corrupted. When logger is removed from functions that are used multiprocessing library everything is working:
Example:
from multiprocessing import Process
from robot.api import logger # to import robot logger lib
def some_func(arg1):
logger.info('Some arg {arg1})
processes = []
for i in range(2):
p = Process(target=some_func, args=(i))
processes.append(p)
for p in processes:
p.start()
for p in processes:
p.join()
Amazon Linux image was used
Received error after test execution:
'output.xml' failed: Incompatible child element 'arg' for 'test'.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the multiprocessing example using Python's multiprocessing library and robot.api.logger, then reproduce the failure on the stated Amazon Linux environment and compare it with macOS. Inspect how concurrent logger calls affect output.xml and its validation. Done means multiprocessing tests can log from separate processes without producing the “Incompatible child element 'arg'” error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100