-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch2 test results in SIGABRT #87
Comments
Hello @vinkaga , Please find the PR vinkaga/oatpp-test#1 I added some comments to the steps of the test and its structure in the code. The main problem was that config components were deleted before Runner object tried to inject them. Apart from that you may find some additional "complicated" code for proper server stoppage and stoppage of async executor. Most of this complexity is because of the "real" port usage and difference in behavior of Linux/BSD api calls, read/write/close. Which you may avoid by using oatpp virtual networking for test purposes. You may also find some useful info here Testing oatpp applications NoteYou are using oatpp Async API for you controller. Developing using Async API may be pretty complicated when it comes to business logic / consuming other services / synchronization. TIP: You may opt to use oatpp simple API (with multi threaded server) instead, which is much more "user friendly". Async API - is needed for cases where you have to handle more than 1K simultaneous connections. Please let me know in case of any questions. Best Regards, |
Closing this. |
I switched to using sync API. In order to remove boilerplate from the tests, I modified TestRunner and ControllerTest. Is this a reasonable approach? |
Hello @vinkaga , I have reviewed the code. Looks good to me. Comments:
Other from that looks great, even that you have defined your own TestRunner. But why not. Regards, |
Hello Leonid, Would take a minute to look over the latest iteration of the my oatpp sample/test at https://github.com/vinkaga/oatpp-test? Here is the list of changes since the last version:
Additionally, not sure why, I get server running/stopped message twice when I run the test. $ ./oatppex_test
Server Running on port 8000
Server Stopped
Server Running on port 8000
Server Stopped
===============================================================================
All tests passed (4 assertions in 2 test cases) Thanks, |
Ignore my silly concern about 2 runs - 2 tests, 2 runs! :-) |
Hello @vinkaga ,
Currently I am not able to review your code. But I will do it for sure. Please feel free to put all the questions you have in the issues,- I will answer them all once I am available. Regards, |
Hello @vinkaga , I have reviewed the code. Everything looks good! Some comments:
Regards, |
Leonid, Thanks again for the feedback.
Thanks a lot. |
I created a simple oatpp controller test using catch2 at https://github.com/vinkaga/oatpp-test. I get the following when I run the test (on x86_64 Mac OS X)
Not sure what I am doing wrong, would appreciate any guidance.
The text was updated successfully, but these errors were encountered: