Skip to content

Conversation

@Bastian-Krause
Copy link
Member

Description
PR #935 added async waiting for the NetworkSerialPort. This makes labgrid-client console --loop work as long as the resource changes from being unavailable to being available. It does not work vice versa, however: the resources are not being updated before being checked for availability. The code inside the while loop does not run in this case.
This makes the subsequent target.await_resources() raise a NoResourceFoundError which is not handled anywhere causing an error message and exit of labgrid-client despite being called with --loop.

Fix that by updating the resources before checking the resource's availability. labgrid-client console --loop will now loop even if the NetworkSerialPort changes from being available to unavailable.

Checklist

  • PR has been tested

Fixes #935
Fixes #926

…ilability

PR labgrid-project#935 added async waiting for the NetworkSerialPort. This makes
`labgrid-client console --loop` work as long as the resource changes
from being unavailable to being available. It does not work vice versa,
however: the resources are not being updated before being checked for
availability. The code inside the while loop does not run in this case.
This makes the subsequent `target.await_resources()` raise a
NoResourceFoundError which is not handled anywhere causing an error
message and exit of labgrid-client despite being called with ``--loop``.

Fix that by updating the resources before checking the resource's
availability. `labgrid-client console --loop` will now loop even if the
NetworkSerialPort changes from being available to unavailable.

Fixes: 2230536 ("remote/client: no block in async console, loop even on unavailable resource")
Signed-off-by: Bastian Krause <bst@pengutronix.de>
@Bastian-Krause
Copy link
Member Author

@khilman Could you give this a test?

@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #941 (9ab0e60) into master (79d1dff) will decrease coverage by 0.0%.
The diff coverage is 0.0%.

@@           Coverage Diff            @@
##           master    #941     +/-   ##
========================================
- Coverage    57.2%   57.1%   -0.1%     
========================================
  Files         150     150             
  Lines       11192   11194      +2     
========================================
  Hits         6402    6402             
- Misses       4790    4792      +2     
Impacted Files Coverage Δ
labgrid/remote/client.py 45.0% <0.0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79d1dff...9ab0e60. Read the comment docs.

@Bastian-Krause
Copy link
Member Author

@Emantor Please wait for @khilman's Tested-by before merging this one.

@khilman
Copy link
Contributor

khilman commented Jun 22, 2022

Works great now, thank you!

Tested-by: Kevin Hilman khilman@baylibre.com

@Bastian-Krause
Copy link
Member Author

Nice, thanks for your feedback!

@Emantor Emantor merged commit 9c4b375 into labgrid-project:master Jun 24, 2022
@Bastian-Krause Bastian-Krause deleted the bst/client-console-update-res branch June 27, 2022 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

labgrid-client console --loop does not loop

3 participants