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

wait_for_idle should raise if apps is not a list #732

Closed
sed-i opened this issue Sep 15, 2022 · 0 comments · Fixed by #741
Closed

wait_for_idle should raise if apps is not a list #732

sed-i opened this issue Sep 15, 2022 · 0 comments · Fixed by #741

Comments

@sed-i
Copy link
Contributor

sed-i commented Sep 15, 2022

It is a common error to pass an str instead of List[str] to apps= in wait_for_idle, and as a result the test fails for timeout:

INFO     juju.model:model.py:2645 Waiting for model:
  p (missing)
  r (missing)
  o (missing)
  m (missing)
  e (missing)
  t (missing)
  h (missing)
  e (missing)
  u (missing)
  s (missing)

It would be handy if the test fails with a more obvious message.

:param apps (list[str]): Optional list of specific app names to wait on.

jujubot added a commit that referenced this issue Oct 13, 2022
#741

#### Description

Currently there's no check for the `apps` argument for the `wait_for_idle()` method. So it goes through any iterable that's passed to it, including strings. As a result `wait_for_idle(apps="test")` produces something like the following:

```
INFO juju.model:model.py:2645 Waiting for model:
 t (missing)
 e (missing)
 s (missing)
 t (missing)
```

This introduces a check for the argument to be a `List[str]`.

Fixes #732 

#### QA Steps

Unit tests are added, should be a simple QA.

```
tox -e py3 -- tests/unit/test_model.py::TestModelWaitForIdle
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant