jiixyj / epoll-shim

small epoll implementation using kqueue; includes all features needed for libinput/libevdev
MIT License
91 stars 24 forks source link

epoll-test.epoll__invalid_op2 failed and epoll-test.epoll__epollhup_on_fresh_socket, epoll-test.epoll__epollpri tests where skipped #24

Open advancedwebdeveloper opened 4 years ago

advancedwebdeveloper commented 4 years ago

Hello.

Here is my situation:

make test

===> Testing for libepoll-shim-0.0.20200602 Test project /usr/ports/devel/libepoll-shim/work/.build Total Test time (real) = 196.91 sec

The following tests did not run: 23 - epoll-test.epoll__epollhup_on_fresh_socket (Skipped) 25 - epoll-test.epoll__epollpri (Skipped)

The following tests FAILED: 6 - epoll-test.epoll__invalid_op2 (Failed) Errors while running CTest *** Error code 8

Stop.

I am on

#uname -a FreeBSD gollvm.build.server 13.0-CURRENT FreeBSD 13.0-CURRENT #0 b9403d7aae8-c254071(main): Thu Oct 29 08:06:03 UTC 2020 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

jiixyj commented 4 years ago

Thanks for the report! Can you run the test with further debug info (ctest -R 'epoll-test.epoll__invalid_op2' -VV) and post the output?

If you are building the port, you can disable that test (or all test) by modifying the ports Makefile in the do-test section (https://svnweb.freebsd.org/ports/head/devel/libepoll-shim/Makefile?revision=537573&view=markup#l21).

The skipped tests are mostly harmless, this is just a result of the epoll emulation not being 100% perfect.

advancedwebdeveloper commented 4 years ago

make test

===> Testing for libepoll-shim-0.0.20200602 UpdateCTestConfiguration from :/usr/ports/devel/libepoll-shim/work/.build/DartConfiguration.tcl Parse Config file:/usr/ports/devel/libepoll-shim/work/.build/DartConfiguration.tcl UpdateCTestConfiguration from :/usr/ports/devel/libepoll-shim/work/.build/DartConfiguration.tcl Parse Config file:/usr/ports/devel/libepoll-shim/work/.build/DartConfiguration.tcl Test project /usr/ports/devel/libepoll-shim/work/.build Constructing a list of tests Done constructing a list of tests Updating test list for fixtures Added 0 tests to meet fixture requirements Checking test dependency graph... Checking test dependency graph end test 6 Start 6: epoll-test.epoll__invalid_op2

6: Test command: /usr/local/bin/cmake "-D" "TEST_FOLDER_NAME=epoll-test.epoll__invalid_op2" "-D" "TEST_EXECUTABLE=/usr/ports/devel/libepoll-shim/work/.build/test/epoll-test" "-D" "TEST_NAME=epollinvalid_op2" "-D" "BINARY_DIR=/usr/ports/devel/libepoll-shim/work/.build/test" "-D" "TIMEOUT=300" "-P" "/usr/ports/devel/libepoll-shim/work/epoll-shim-3840e9c/test/cmake/ATFRunTest.cmake" 6: Test timeout computed to be: 0 6: -- result: 0, passed 1/1 Test #6: epoll-test.epollinvalid_op2 .... Passed 39.34 sec

The following tests passed: epoll-test.epoll__invalid_op2

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 39.40 sec

jiixyj commented 4 years ago

Weird, looks like the test is passing now...

advancedwebdeveloper commented 4 years ago

Probably the problem is in the configuration file.

What about those 2 skipped tests? Do you lack anything in your shim, to make it work?

jiixyj commented 4 years ago

Sometimes there are inherent limitations in kqueue or the various BSDs that make 100% exact emulation impossible. For example, emulation for EPOLLPRI (out of band socket data) is only possible on DragonFlyBSD which implements EVFILT_EXCEPT. On FreeBSD we can emulate it in level-triggered mode using normal poll and POLLPRI, but edge-triggered epoll requires more kernel support.

The most common use cases should be supported, however.

advancedwebdeveloper commented 4 years ago

I see.

What about if you can help with external task, like geeting rid of epoll abstraction + the shim, for porting libbacktrace, to FreeBSD 13.0?

So it would be possible to deal with kqueue directly.