Skip to content
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

flaky system test: tedge_connect_test_sm_services #3022

Open
reubenmiller opened this issue Jul 29, 2024 · 1 comment
Open

flaky system test: tedge_connect_test_sm_services #3022

reubenmiller opened this issue Jul 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@reubenmiller
Copy link
Contributor

Describe the bug

Flaky system test.

Test name

tedge_connect_test_sm_services

Failures

message=Warning should not be displayed if the port does not match. Issue #2863: 'Checking if systemd is available.

Validating the bridge certificates.

Creating the device in Cumulocity cloud.

Deleting mosquitto bridge configuration in favour of built-in bridge

Restarting mosquitto service.

Awaiting mosquitto to start. This may take up to 5 seconds.

Enabling mosquitto service on reboots.

Successfully created bridge connection!

Checking if tedge-mapper is installed.

Starting tedge-mapper-c8y service.

Persisting tedge-mapper-c8y on reboot.

tedge-mapper-c8y service successfully started and enabled!

Sending packets to check connection. This may take up to 2 seconds.

Warning: Bridge has been configured, but Cumulocity connection check failed.

Enabling software management.

Checking if tedge-agent is installed.

Starting tedge-agent service.

Persisting tedge-agent on reboot.

tedge-agent service successfully started and enabled!

' contains 'Warning:'

Build seen on

To Reproduce

Invoked with:

invoke flake-finder --suite tedge_connect_test --iterations 5 --clean

Result:

Overall: FAILED
Results: 5 iterations, 2 passed, 3 failed
Elapsed time: 0:04:42.355737
Failed iterations: [1, 3, 4]

Expected behavior

The test should pass consistently.

@reubenmiller reubenmiller added the bug Something isn't working label Jul 29, 2024
@reubenmiller
Copy link
Contributor Author

After some investigation it seem the failure is related to the built-in bridge functionality. All of the tests in the suite are executed on the same device, and the proceeding test inadvertently enables the built-in bridge when "cleaning up", see below for the test where this happens.

Non-root users should be able to read the mosquitto configuration files #2154
    [Tags]    \#2154
    Execute Command    sudo tedge connect c8y || true
    Should Have File Permissions    /etc/tedge/mosquitto-conf/tedge-mosquitto.conf    644 root:root
    Execute Command    sudo tedge config set mqtt.bridge.built_in false
    Execute Command    sudo tedge reconnect c8y
    Should Have File Permissions    /etc/tedge/mosquitto-conf/tedge-mosquitto.conf    644 root:root
    Should Have File Permissions    /etc/tedge/mosquitto-conf/c8y-bridge.conf    644 root:root
    Execute Command    sudo tedge config set mqtt.bridge.built_in true  # Reset things after running the test

As a first measure, the test should be updated to unset the mqtt.bridge.built_in setting instead of assuming it is of a particular value or not. The built-in bridge tests will be covered in another PR, #2911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant