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

order in cleanup function #265

Closed
SBlechmann opened this issue Apr 3, 2024 · 6 comments · Fixed by #267
Closed

order in cleanup function #265

SBlechmann opened this issue Apr 3, 2024 · 6 comments · Fixed by #267
Assignees
Labels
bug Something isn't working

Comments

@SBlechmann
Copy link
Contributor

The order in which the cleanup functions are called is important (afaik, only if there is an iot device holding a command).

In the tutorials, the order of the functions called is correct.
Yet, we just discovered this when calling the functions in a different order, e.g. clear the cb and then the iota, the iota throws an 400 error that the connection to the cb failed.

Maybe we should add this to the docs somewhere?

@SBlechmann SBlechmann added the bug Something isn't working label Apr 3, 2024
Copy link

github-actions bot commented Apr 3, 2024

Branch 265-order-in-cleanup-function created!

@djs0109
Copy link
Contributor

djs0109 commented Apr 3, 2024

@SBlechmann could you provide some simple coded for reproducing the error?

@djs0109
Copy link
Contributor

djs0109 commented Apr 3, 2024

Is it the correct workflow to:

  1. first create a device with command
  2. clear orion with clear_context_brocker( )
  3. clear iotagent with clear_iot_agent () will raise the same error

@djs0109
Copy link
Contributor

djs0109 commented Apr 3, 2024

@SystemsPurge could you reproduce this error and implement it into a unitest, maybe under tests/clients/test_ngsi_v2_iota.py

@SystemsPurge
Copy link
Collaborator

@djs0109 test is written. Still to see why assertRaises is not catching the HTTPError exception in this case.

@SystemsPurge
Copy link
Collaborator

SystemsPurge commented Apr 4, 2024

@djs0109 Test was not working because it involves clear methods that are subsequently used by the teardown method, so i added a try , except at the teardown but maybe someone should have a better look into that. Should this be pushed to 215?

EDIT: Okay i should read more carefully next time.

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

Successfully merging a pull request may close this issue.

3 participants