Hello,
my assumption for robot framework is, that at any kind of error in the robot process at least the return code of the robot process indicates an (fatal) error.
But what I see is that after an error (see below) the test runs until its end, status FAIL gets written to the XML output file and then “everything aborts” (-> no more logs, XML file incomplete) and process return code is 0, which means “All tests passed.”.
The error that occurs happens this way:
- Robot test script calls python keyword
- python code calls via ctypes a function in DLL, written in C, compiled with MSVC
- The DLL starts multiple threads via Win32 API
- One of these threads uses a NULL pointer. This leads to an unhandled “read access violation” exception.
- After that robot behaves as written above
Should robot framework be able to handle that gracefully? For example somehow catch this exception and exit with return code -1.
My solution is to register a handler in the DLL for unhandled exceptions via Win32 function SetUnhandledExceptionFilter() and calling exit(-1) in this handler. This works reliably.
Is there a better solution to handle such errors gracefully?
Or can robot framework be enabled to handle such errors gracefully?
Best regards
Christian