Open seifertm opened 5 years ago
Hey! Hehe, I am trying to pack this python package into Gentoo too! :) My gentoo bug is https://bugs.gentoo.org/669272 What is your gentoo bug or pull request? So we do not do the same job twice.
I am also having the same issue. If I discover anything worthwhile I'll post here.
Ah, thanks for the information :) I did not open a Gentoo bug or pull request, because I do not want to be a maintainer of the package (yet). I added it to my overlay: https://github.com/digitalernachschub/gentoo-overlay/blob/master/dev-python/asynctest/asynctest-0.12.2.ebuild
Hi,
Thanks for the report. According to the man, EPERM on epoll_ctl happens when:
"The target file fd does not support epoll. This error can occur if fd refers to, for example, a regular file or a directory."
In this case, it seems to be because we are trying to register a FileMock obect, but the loop in a test case is patched to support this.
Can you tell me which exact version of Python you are using and in which order the tests are running (especially, which tests run before this one)? Also, are you running the test suite in a sandboxed environment (as in "the test suite is executed in the packaging script")?
Le ven. 16 nov. 2018 à 08:19, Michael Seifert notifications@github.com a écrit :
Ah, thanks for the information :) I did not open a Gentoo bug or pull request, because I do not want to be a maintainer of the package (yet). I added it to my overlay: https://github.com/digitalernachschub/gentoo-overlay/blob/master/dev-python/asynctest/asynctest-0.12.2.ebuild
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Martiusweb/asynctest/issues/112#issuecomment-439304096, or mute the thread https://github.com/notifications/unsubscribe-auth/AAL7GDyeVHRK_EjaPTZSWT-55Pre96KDks5uvmbogaJpZM4YdhPI .
-- Martin http://www.martiusweb.net Richard www.martiusweb.net
Hi! :) Thanks to you for willing to have a look!
So the list of tests in the order of execution is the following:
test_exhaust_callbacks_cascading_callbacks (test.test_helpers.TestExhaust) ... ok
test_exhaust_callbacks_nothing_to_wait (test.test_helpers.TestExhaust) ... ok
test_exhaust_callbacks_one_callback (test.test_helpers.TestExhaust) ... ok
test_CoroutineMock_inherits_from_Mock (test.test_mock.TestMockInheritanceModel) ... ok
test_MagicMock_inherits_from_Mock (test.test_mock.TestMockInheritanceModel) ... ok
test_MagicMock_is_not_CoroutineMock (test.test_mock.TestMockInheritanceModel) ... ok
test_Mock_inherits_from_NonCallableMock (test.test_mock.TestMockInheritanceModel) ... ok
test_Mock_is_not_CoroutineMock (test.test_mock.TestMockInheritanceModel) ... ok
test_NonCallableMagicMock_inherits_from_NonCallableMock (test.test_mock.TestMockInheritanceModel) ... ok
test_advance (test.test_case.Test_ClockedTestCase) ... ok
test_advance_with_run_until_complete (test.test_case.Test_ClockedTestCase) ... ok
test_callbacks_are_called_on_time (test.test_case.Test_ClockedTestCase) ... ok
test_negative_advance (test.test_case.Test_ClockedTestCase) ... ok
test_setUp (test.test_case.Test_ClockedTestCase_async_setUp) ... ok
test_setUp (test.test_case.Test_ClockedTestCase_setUp) ... ok
test_asyncio_iscoroutinefunction (test.test_mock.Test_CoroutineMock) ... ok
test_called_CoroutineMock_returns_MagicMock (test.test_mock.Test_CoroutineMock) ... ok
test_exception_side_effect_raises_in_coroutine (test.test_mock.Test_CoroutineMock) ... ok
test_mock_has_correct_name (test.test_mock.Test_CoroutineMock) ... ok
test_mock_returns_coroutine_according_to_spec (test.test_mock.Test_CoroutineMock) ... ok
test_returns_coroutine (test.test_mock.Test_CoroutineMock) ... ok
test_returns_coroutine_from_return_value (test.test_mock.Test_CoroutineMock) ... ok
test_returns_coroutine_from_side_effect (test.test_mock.Test_CoroutineMock) ... ok
test_returns_coroutine_from_side_effect_being_a_coroutine (test.test_mock.Test_CoroutineMock) ... ok
test_returns_coroutine_from_side_effect_being_an_iterable (test.test_mock.Test_CoroutineMock) ... ok
test_returns_coroutine_with_return_value_being_a_coroutine (test.test_mock.Test_CoroutineMock) ... ok
test_assert_any_wait (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_assert_awaited (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_assert_awaited_once (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_assert_awaited_once_with (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_assert_awaited_with (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_assert_has_awaits (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_assert_not_awaited (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_await_args (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_await_args_list (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_awaited_CoroutineMock_counts (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_awaited_CoroutineMock_sets_awaited (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_awaited_delays_creation_of_condition (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_awaited_from_autospec_mock (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_awaited_wait (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_awaited_wait_next (test.test_mock.Test_CoroutineMock_awaited) ... ok
test_init_increments_value (test.test_selector.Test_FileDescriptor) ... ok
test_init_increments_value_with_fixed_value (test.test_selector.Test_FileDescriptor) ... ok
test_is_an_int (test.test_selector.Test_FileDescriptor) ... ok
test_fileno_returns_FileDescriptor (test.test_selector.Test_FileMock) ... ok
test_mock_a_future_is_a_future (test.test_mock.Test_MagicMock) ... ok
test_mock_from_create_future (test.test_mock.Test_MagicMock) ... ok
test_mock_has_correct_name (test.test_mock.Test_MagicMock) ... ok
test_mock_is_not_coroutine_when_spec_is_function (test.test_mock.Test_MagicMock) ... ok
test_mock_returns_coroutine_according_to_spec (test.test_mock.Test_MagicMock) ... ok
test_subclass (test.test_mock.Test_MagicMock) ... ok
test_mock_a_future_is_a_future (test.test_mock.Test_Mock) ... ok
test_mock_from_create_future (test.test_mock.Test_Mock) ... ok
test_mock_has_correct_name (test.test_mock.Test_Mock) ... ok
test_mock_is_not_coroutine_when_spec_is_function (test.test_mock.Test_Mock) ... ok
test_mock_returns_coroutine_according_to_spec (test.test_mock.Test_Mock) ... ok
test_subclass (test.test_mock.Test_Mock) ... ok
test_asyncio_iscoroutinefunction (test.test_mock.Test_NonCallabableMock) ... ok
test_is_coroutine_property (test.test_mock.Test_NonCallabableMock) ... ok
test_mock_a_future_is_a_future (test.test_mock.Test_NonCallabableMock) ... ok
test_mock_from_create_future (test.test_mock.Test_NonCallabableMock) ... ok
test_mock_has_correct_name (test.test_mock.Test_NonCallabableMock) ... ok
test_mock_is_not_coroutine_when_spec_is_function (test.test_mock.Test_NonCallabableMock) ... ok
test_mock_returns_coroutine_according_to_spec (test.test_mock.Test_NonCallabableMock) ... ok
test_subclass (test.test_mock.Test_NonCallabableMock) ... ok
test_asyncio_iscoroutinefunction (test.test_mock.Test_NonCallableMagicMock) ... ok
test_is_coroutine_property (test.test_mock.Test_NonCallableMagicMock) ... ok
test_mock_a_future_is_a_future (test.test_mock.Test_NonCallableMagicMock) ... ok
test_mock_from_create_future (test.test_mock.Test_NonCallableMagicMock) ... ok
test_mock_has_correct_name (test.test_mock.Test_NonCallableMagicMock) ... ok
test_mock_is_not_coroutine_when_spec_is_function (test.test_mock.Test_NonCallableMagicMock) ... ok
test_mock_returns_coroutine_according_to_spec (test.test_mock.Test_NonCallableMagicMock) ... ok
test_subclass (test.test_mock.Test_NonCallableMagicMock) ... ok
test_is_ssl_socket (test.test_selector.Test_SSLSocketMock) ... ok
test_is_socket (test.test_selector.Test_SocketMock) ... ok
test_cleanup_functions_can_be_coroutines (test.test_case.Test_TestCase) ... ok
test_coroutine_returned_executed (test.test_case.Test_TestCase) ... ok
test_coroutinefunction_executed (test.test_case.Test_TestCase) ... ok
test_default_loop_is_not_created_when_unused (test.test_case.Test_TestCase) ... ok
test_fails_when_future_has_scheduled_calls (test.test_case.Test_TestCase) ... ok
test_forbid_get_event_loop (test.test_case.Test_TestCase) ... ok
test_init_and_close_loop_for_test (test.test_case.Test_TestCase) ... ok
test_loop_uses_TestSelector (test.test_case.Test_TestCase) ... ok
test_setup_teardown_may_be_coroutines (test.test_case.Test_TestCase) ... ok
test_update_default_loop_works (test.test_case.Test_TestCase) ... ok
test_use_default_loop (test.test_case.Test_TestCase) ... ok
test_original_watcher_works_outside_loop (test.test_case.Test_TestCase_and_ChildWatcher) ... ok
test_watched_process_is_awaited (test.test_case.Test_TestCase_and_ChildWatcher) ... ok
test_close (test.test_selector.Test_TestSelector) ... ok
test_modify_but_selector_raises (test.test_selector.Test_TestSelector) ... ok
test_modify_fd (test.test_selector.Test_TestSelector) ... ok
test_modify_fileno (test.test_selector.Test_TestSelector) ... ok
test_modify_mock (test.test_selector.Test_TestSelector) ... ok
test_register_fileno (test.test_selector.Test_TestSelector) ... ok
test_register_mock (test.test_selector.Test_TestSelector) ... ok
test_select (test.test_selector.Test_TestSelector) ... ok
test_unregister_fileno (test.test_selector.Test_TestSelector) ... ok
test_unregister_mock (test.test_selector.Test_TestSelector) ... ok
test_assertAsyncRaises (test.test_case.Test_assertAsyncRaises) ... ok
test_assertAsyncRaisesRegex (test.test_case.Test_assertAsyncRaises) ... ok
test_assertAsyncWarns (test.test_case.Test_assertAsyncWarns) ... ok
test_assertAsyncWarnsRegex (test.test_case.Test_assertAsyncWarns) ... ok
test_autospec_attributes_being_coroutine_functions (test.test_mock.Test_create_autospec) ... ok
test_autospec_of_coroutine_function_is_coroutinefunction (test.test_mock.Test_create_autospec) ... ok
test_autospec_returns_asynctest_mocks (test.test_mock.Test_create_autospec) ... ok
test_create_autospec_on_coroutine_with_coroutine_side_effect (test.test_mock.Test_create_autospec) ... ok
test_create_autospec_on_coroutine_with_exception_side_effect (test.test_mock.Test_create_autospec) ... ok
test_create_autospec_on_coroutine_with_instance_raises_RuntimeError (test.test_mock.Test_create_autospec) ... ok
test_create_autospec_on_coroutine_with_iterable_side_effect (test.test_mock.Test_create_autospec) ... ok
test_create_autospec_on_coroutine_with_return_value (test.test_mock.Test_create_autospec) ... ok
test_generator_and_coroutine_is_instance_of_FunctionType (test.test_mock.Test_create_autospec) ... ok
test_before_test_called_before_user_setup (test.test_case.Test_fail_on) ... ok
test_before_test_called_for_enabled_checks_only (test.test_case.Test_fail_on) ... ok
test_check_after_tearDown (test.test_case.Test_fail_on) ... ok
test_checks_on_decorated_class (test.test_case.Test_fail_on) ... ok
test_default_checks (test.test_case.Test_fail_on) ... ok
test_non_existing_before_test_wont_fail (test.test_case.Test_fail_on) ... ok
test_events_watched_outside_test_are_ignored (test.test_selector.Test_fail_on_active_selector_callbacks) ... ERROR
test_fail_on_active_selector_callbacks_on_mock_files (test.test_selector.Test_fail_on_active_selector_callbacks) ... ok
test_fail_on_original_selector_callback (test.test_selector.Test_fail_on_active_selector_callbacks) ... ok
test_passes_when_no_callbacks_left (test.test_selector.Test_fail_on_active_selector_callbacks) ... ok
test_passes_without_callbacks_set (test.test_selector.Test_fail_on_active_selector_callbacks) ... ok
test_check_arguments (test.test_case.Test_fail_on_decorator) ... ok
test_decorate_class (test.test_case.Test_fail_on_decorator) ... ok
test_decorate_method (test.test_case.Test_fail_on_decorator) ... ok
test_decorate_subclass_doesnt_affect_base_class (test.test_case.Test_fail_on_decorator) ... ok
test_decorate_subclass_inherits_parent_params (test.test_case.Test_fail_on_decorator) ... ok
test_lenient_decorator (test.test_case.Test_fail_on_decorator) ... ok
test_strict_decorator (test.test_case.Test_fail_on_decorator) ... ok
test_fails_when_loop_didnt_run (test.test_case.Test_fail_on_unused_loop) ... ok
test_fails_when_loop_didnt_run_using_default_loop (test.test_case.Test_fail_on_unused_loop) ... ok
test_fails_when_loop_ran_only_during_cleanup (test.test_case.Test_fail_on_unused_loop) ... ok
test_fails_when_loop_ran_only_during_setup (test.test_case.Test_fail_on_unused_loop) ... ok
test_passes_when_ignore_loop_or_loop_run (test.test_case.Test_fail_on_unused_loop) ... ok
test_MagicMock_returned_by_default (test.test_mock.Test_mock_open) ... ok
test_patch_as_context_manager_uses_CoroutineMock_on_classmethod_coroutine_function (test.test_mock.Test_patch) ... ok
test_patch_as_context_manager_uses_CoroutineMock_on_coroutine_function (test.test_mock.Test_patch) ... ok
test_patch_as_context_manager_uses_CoroutineMock_on_staticmethod_coroutine_function (test.test_mock.Test_patch) ... ok
test_patch_as_context_manager_uses_MagicMock (test.test_mock.Test_patch) ... ok
test_patch_as_decorator_uses_CoroutineMock_on_classmethod_coroutine_function (test.test_mock.Test_patch) ... ok
test_patch_as_decorator_uses_CoroutineMock_on_coroutine_function (test.test_mock.Test_patch) ... ok
test_patch_as_decorator_uses_CoroutineMock_on_staticmethod_coroutine_function (test.test_mock.Test_patch) ... ok
test_patch_as_decorator_uses_MagicMock (test.test_mock.Test_patch) ... ok
test_patch_is_enabled_when_running_decorated_coroutine (test.test_mock.Test_patch) ... ok
test_patch_is_enabled_when_running_decorated_function (test.test_mock.Test_patch) ... ok
test_both_patch_and_patch_dict_with_scope_global (test.test_mock.Test_patch_and_patch_dict_scope) ... ok
test_both_patch_and_patch_dict_with_scope_limited (test.test_mock.Test_patch_and_patch_dict_scope) ... ok
test_autospec_coroutine (test.test_mock.Test_patch_autospec) ... ok
test_patch_autospec_with_patches_on_top (test.test_mock.Test_patch_autospec) ... ok
test_patch_autospec_with_patches_under (test.test_mock.Test_patch_autospec) ... ok
test_patch_multiple_autospec (test.test_mock.Test_patch_autospec) ... ok
test_patch_object_autospec (test.test_mock.Test_patch_autospec) ... ok
test_coroutine_arg_is_default_mock (test.test_mock.Test_patch_decorator_coroutine_or_generator) ... ok
test_coroutine_type_when_patched (test.test_mock.Test_patch_decorator_coroutine_or_generator) ... ok
test_generator_arg_is_default_mock (test.test_mock.Test_patch_decorator_coroutine_or_generator) ... ok
test_default_scope_is_global (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope) ... ok
test_patch_coroutine_with_multiple_scopes (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope) ... ok
test_patch_generator_with_multiple_scopes (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope) ... ok
test_deactivate_patch_when_generator_exec_fails (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_GLOBAL) ... ok
test_deactivate_patch_when_generator_init_fails (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_GLOBAL) ... ok
test_multiple_patches_on_coroutine (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_GLOBAL) ... ok
test_multiple_patches_on_generator (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_GLOBAL) ... ok
test_patch_coroutine_during_its_lifetime (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_GLOBAL) ... ok
test_patch_generator_during_its_lifetime (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_GLOBAL) ... ok
test_patch_stopped_when_generator_is_collected (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_GLOBAL) ... ok
test_deactivate_patch_when_generator_exec_fails (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_LIMITED) ... ok
test_deactivate_patch_when_generator_init_fails (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_LIMITED) ... ok
test_multiple_patches_on_coroutine (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_LIMITED) ... ok
test_patch_coroutine_only_when_running (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_LIMITED) ... ok
test_patch_generator_only_when_running (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_LIMITED) ... ok
test_patched_coroutine_with_mock_args (test.test_mock.Test_patch_decorator_coroutine_or_generator_scope_LIMITED) ... ok
test_patch_decorates_class (test.test_mock.Test_patch_dict) ... ok
test_patch_decorates_coroutine (test.test_mock.Test_patch_dict) ... ok
test_patch_decorates_function (test.test_mock.Test_patch_dict) ... ok
test_default_scope_is_global (test.test_mock.Test_patch_dict_decorator_coroutine_or_generator_scope) ... ok
test_patch_coroutine_with_multiple_scopes (test.test_mock.Test_patch_dict_decorator_coroutine_or_generator_scope) ... ok
test_patch_generator_with_multiple_scopes (test.test_mock.Test_patch_dict_decorator_coroutine_or_generator_scope) ... ok
test_patch_generator_with_multiple_scopes_on_same_dict (test.test_mock.Test_patch_dict_decorator_coroutine_or_generator_scope) ... ok
test_scope_limited (test.test_mock.Test_patch_dict_decorator_coroutine_or_generator_scope) ... ok
test_patch_coroutine_function_with_CoroutineMock (test.test_mock.Test_patch_multiple) ... ok
test_patch_decorates_coroutine (test.test_mock.Test_patch_multiple) ... ok
test_patch_with_MagicMock (test.test_mock.Test_patch_multiple) ... ok
test_patch_coroutine_function_with_CoroutineMock (test.test_mock.Test_patch_object) ... ok
test_patch_decorates_coroutine (test.test_mock.Test_patch_object) ... ok
test_patch_with_MagicMock (test.test_mock.Test_patch_object) ... ok
test_default_value (test.test_mock.Test_return_once) ... ok
test_then (test.test_mock.Test_return_once) ... ok
test_with_side_effect_default (test.test_mock.Test_return_once) ... ok
test_with_side_effect_raises (test.test_mock.Test_return_once) ... ok
test_with_side_effect_raises_all (test.test_mock.Test_return_once) ... ok
test_with_side_effect_raises_then (test.test_mock.Test_return_once) ... ok
test_with_side_effect_then (test.test_mock.Test_return_once) ... ok
test_callback_scheduled (test.test_selector.Test_set_read_write_ready) ... ok
test_callback_scheduled_during_current_iteration (test.test_selector.Test_set_read_write_ready) ... ok
test_nothing_scheduled (test.test_selector.Test_set_read_write_ready) ... ok
======================================================================
ERROR: test_events_watched_outside_test_are_ignored (test.test_selector.Test_fail_on_active_selector_callbacks)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.4/asyncio/selector_events.py", line 234, in add_reader
key = self._selector.get_key(fd)
File "/usr/lib64/python3.4/selectors.py", line 182, in get_key
raise KeyError("{!r} is not registered".format(fileobj)) from None
KeyError: "<FileMock id='140419331941152'> is not registered"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib64/python3.4/unittest/mock.py", line 1555, in _inner
return f(*args, **kw)
File "/var/tmp/portage/dev-python/asynctest-0.12.2/work/asynctest-0.12.2/test/test_selector.py", line 295, in test_events_watched_outside_test_are_ignored
loop.add_reader(mock, lambda: None)
File "/usr/lib64/python3.4/asyncio/selector_events.py", line 237, in add_reader
(handle, None))
File "/usr/lib64/python3.4/selectors.py", line 403, in register
self._epoll.register(key.fd, epoll_events)
PermissionError: [Errno 1] Operation not permitted
----------------------------------------------------------------------
Ran 195 tests in 0.302s
The command line that kicks in the tests is python -m unittest -v test
I am afraid it fails on all python versions. At least in my case I confirm it to fail with the same error message for python of versions:
The tests are being executed within portage sandbox. I am not very strong about what it actually means. Also, I did try to disable all such 'sandboxing' concepts within Portage (portage is a gentoo package manager) but the test failure persisted. I do accept there's a chance that I did not disable all the sandboxing features of portage since I am just learning inners of portage.
Also, in case it helps - I tried to pack the bleeding edge, i.e. current master of asynctest into Gentoo and the outcome was the same - the same test was failing. So at the moment I am targeting 0.12.2 version. Though I am fine to switch back to the current master snapshot if that's necessary.
Same here on Fedora rawhide.
Interestingly enough, if I enter the build container using mock -r fedora-rawhide-x86_64 shell
and run the testsuite manually (PYTHONPATH=$(pwd) python3 -m unittest test
) it doesn't fail.
I am currently trying to package asynctest-0.12.2 for Gentoo Linux and I am running into a test error:
I acquired the source tarball from PyPI and executed the test with the command
PYTHONPATH=. python3.6 -m unittest --verbose test
. All other tests run successfully.Am I doing something wrong or can you reproduce the issue, too?