ros2 / ros2/examples

failure in the `colcon test`

Open
#325 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

more-information-needed
Dominant language
C++
Stars
970
Forks
365
Avg merge
12d 20h
Merged PRs (30d)
1

Description

Hi, following ros2-foxy tutorial I have a failure in the colcon test.

Bug report

Required Info:

  • Operating System:
    Ubuntu 20.04
  • Installation type:
    from source
  • Version or commit hash:
    3eb5abc
  • DDS implementation:
    Fast-RTPS
  • Client library (if applicable):
    examples_rclpy_minimal_client
Steps to reproduce issue
Summary: 16 packages finished [4.51s]
  1 package had test failures: examples_rclpy_minimal_client
Additional information

cat log/latest_test/examples_rclpy_minimal_client/stdout_stderr.log

Output:

============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
cachedir: /home/user/ros2_ws_all/ros2_example_ws/build/examples_rclpy_minimal_client/.pytest_cache
rootdir: /home/user/ros2_ws_all/ros2_example_ws/src/examples/rclpy, configfile: pytest.ini
plugins: ament-copyright-0.9.6, ament-mypy-0.9.6, ament-flake8-0.9.6, ament-xmllint-0.9.6, ament-lint-0.9.6, ament-pep257-0.9.6, launch-testing-ros-0.11.3, launch-testing-0.10.6, colcon-core-0.6.1, repeat-0.9.1, rerunfailures-10.2, flake8-1.0.7, mock-1.10.4, cov-2.8.1
collecting ... 
collected 3 items                                                              

test/test_copyright.py .                                                 [ 33%]
test/test_flake8.py F                                                    [ 66%]
test/test_pep257.py .                                                    [100%]

=================================== FAILURES ===================================
_________________________________ test_flake8 __________________________________
test/test_flake8.py:23: in test_flake8
    assert rc == 0, \
E   AssertionError: Found 4 code style errors / warnings:
E     ./examples_rclpy_minimal_client/client.py:36:1: B902 blind except Exception: statement
E     ./examples_rclpy_minimal_client/client_async_callback.py:42:1: B902 blind except Exception: statement
E     ./examples_rclpy_minimal_client/client_async.py:39:1: B902 blind except Exception: statement
E     ./examples_rclpy_minimal_client/client_async_member_function.py:47:1: B902 blind except Exception: statement
E   assert 1 == 0
----------------------------- Captured stdout call -----------------------------

./examples_rclpy_minimal_client/client.py:36:1: B902 blind except Exception: statement
    except Exception as e:
^

./examples_rclpy_minimal_client/client_async_callback.py:42:1: B902 blind except Exception: statement
            except Exception as e:
^

./examples_rclpy_minimal_client/client_async.py:39:1: B902 blind except Exception: statement
            except Exception as e:
^

./examples_rclpy_minimal_client/client_async_member_function.py:47:1: B902 blind except Exception: statement
            except Exception as e:
^

4     B902 blind except Exception: statement

9 files checked
4 errors

'B'-type errors: 4

Checked files:

* ./setup.py
* ./examples_rclpy_minimal_client/__init__.py
* ./examples_rclpy_minimal_client/client.py
* ./examples_rclpy_minimal_client/client_async_callback.py
* ./examples_rclpy_minimal_client/client_async.py
* ./examples_rclpy_minimal_client/client_async_member_function.py
* ./test/test_flake8.py
* ./test/test_copyright.py
* ./test/test_pep257.py
- generated xml file: cat  -
=========================== short test summary info ============================
FAILED test/test_flake8.py::test_flake8 - AssertionError: Found 4 code style ...
========================= 1 failed, 2 passed in 0.29s ==========================

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/test_flake8.py and the four reported files: examples_rclpy_minimal_client/client.py, client_async_callback.py, client_async.py, and client_async_member_function.py. Run the package's focused flake8 test first, then run colcon test for examples_rclpy_minimal_client; done means the four B902 failures are resolved and all three tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
robotics, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.