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

[fix] Fixed the default test #139 #228

Merged
merged 2 commits into from
Feb 18, 2025
Merged

Conversation

pandafy
Copy link
Member

@pandafy pandafy commented Feb 12, 2025

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #139

Description of Changes

  • Increased test_retries to 10
  • If the default test fails, the agent will wait randomly between 5 and 20 seconds before re-attempting the test.
  • Improved logging for failures.

If the default test fails, the agent will wait randomly
between 5 and 20 seconds before re-attempting the test.
Improved logging for failures.
@pandafy pandafy requested a review from okraits February 17, 2025 09:53
@pandafy
Copy link
Member Author

pandafy commented Feb 17, 2025

I have tested the scenario where the server returns 502 Bad Gateway response for default test on OpenWrt 24.10

Mon Feb 17 15:17:43 2025 daemon.info openwisp: Testing configuration...
Mon Feb 17 15:17:43 2025 daemon.warn openwisp: Configuration test passed, but the controller returned HTTP/1.1 502 Bad Gateway
Mon Feb 17 15:17:43 2025 daemon.info openwisp: Configuration test succeeded
Mon Feb 17 15:17:43 2025 daemon.info openwisp: Configuration applied successfully

I have also tested the scenario when the default test fails when the connection timed out. The agent retried for 10 times

Mon Feb 17 15:19:36 2025 daemon.info openwisp: Local configuration outdated
Mon Feb 17 15:19:36 2025 daemon.info openwisp: Downloading configuration from controller...
Mon Feb 17 15:19:36 2025 daemon.info openwisp: Configuration downloaded, now applying it...
Mon Feb 17 15:19:37 2025 daemon.info openwisp: Service system has been reloaded via procd/ubus
Mon Feb 17 15:19:42 2025 daemon.info openwisp: Testing configuration...
Mon Feb 17 15:20:12 2025 daemon.warn openwisp: Configuration test failed (attempt 1). Failed to connect to controller: curl exit code 28
Mon Feb 17 15:20:51 2025 daemon.warn openwisp: Configuration test failed (attempt 2). Failed to connect to controller: curl exit code 28
Mon Feb 17 15:21:33 2025 daemon.warn openwisp: Configuration test failed (attempt 3). Failed to connect to controller: curl exit code 28
Mon Feb 17 15:22:09 2025 daemon.warn openwisp: Configuration test failed (attempt 4). Failed to connect to controller: curl exit code 28
Mon Feb 17 15:22:54 2025 daemon.warn openwisp: Configuration test failed (attempt 5). Failed to connect to controller: curl exit code 28
Mon Feb 17 15:23:41 2025 daemon.warn openwisp: Configuration test failed (attempt 6). Failed to connect to controller: curl exit code 28
Mon Feb 17 15:24:18 2025 daemon.warn openwisp: Configuration test failed (attempt 7). Failed to connect to controller: curl exit code 28
Mon Feb 17 15:25:03 2025 daemon.warn openwisp: Configuration test failed (attempt 8). Failed to connect to controller: curl exit code 28
Mon Feb 17 15:25:41 2025 daemon.warn openwisp: Configuration test failed (attempt 9). Failed to connect to controller: curl exit code 28
Mon Feb 17 15:26:19 2025 daemon.warn openwisp: Configuration test failed (attempt 10). Failed to connect to controller: curl exit code 28

@nemesifier nemesifier merged commit c81f09f into master Feb 18, 2025
2 checks passed
@nemesifier nemesifier deleted the issues/139-config-restored branch February 18, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

[bug] Configuration reported as errored: false positives
2 participants