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

test_app_state_api[MultiProcessRuntime] fails with KeyError: 'flows' on macOS in CI #15936

Closed
akihironitta opened this issue Dec 7, 2022 · 4 comments
Assignees
Labels
app (removed) Generic label for Lightning App package bug Something isn't working ci Continuous Integration tests

Comments

@akihironitta
Copy link
Contributor

akihironitta commented Dec 7, 2022

Bug description

See title and log.

How to reproduce the bug

No response

Error messages and logs

Process ForkProcess-32:
Traceback (most recent call last):
  File "/Users/runner/hostedtoolcache/Python/3.9.14/x64/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/Users/runner/hostedtoolcache/Python/3.9.14/x64/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/runner/work/lightning/lightning/src/lightning/app/utilities/proxies.py", line 419, in __call__
    raise e
  File "/Users/runner/work/lightning/lightning/src/lightning/app/utilities/proxies.py", line 402, in __call__
    self.run_once()
  File "/Users/runner/work/lightning/lightning/src/lightning/app/utilities/proxies.py", line 550, in run_once
    self.work.on_exception(e)
  File "/Users/runner/work/lightning/lightning/src/lightning/app/core/work.py", line 567, in on_exception
    raise exception
  File "/Users/runner/work/lightning/lightning/src/lightning/app/utilities/proxies.py", line 515, in run_once
    ret = self.run_executor_cls(self.work, work_run, self.delta_queue)(*args, **kwargs)
  File "/Users/runner/work/lightning/lightning/src/lightning/app/utilities/proxies.py", line 351, in __call__
    return self.work_run(*args, **kwargs)
  File "/Users/runner/work/lightning/lightning/tests/tests_app/core/test_lightning_api.py", line 53, in run
    assert state.var_a == 0
  File "/Users/runner/work/lightning/lightning/src/lightning/app/utilities/state.py", line 168, in __getattr__
    self._request_state()
  File "/Users/runner/work/lightning/lightning/src/lightning/app/utilities/state.py", line 161, in _request_state
    self._store_state(response.json())
  File "/Users/runner/work/lightning/lightning/src/lightning/app/utilities/state.py", line 127, in _store_state
    self._last_state = self._find_state_under_affiliation(_LAST_STATE, self._my_affiliation)
  File "/Users/runner/work/lightning/lightning/src/lightning/app/utilities/state.py", line 110, in _find_state_under_affiliation
    if name in children_state["flows"]:
KeyError: 'flows'
=========================== short test summary info ============================
FAILED tests_app/core/test_lightning_api.py::test_app_state_api[MultiProcessRuntime] - SystemExit: 1
===== 1 failed, 589 passed, 50 skipped, 2122 warnings in 451.32s (0:07:31) =====
Error: Process completed with exit code 1.

Environment

https://github.com/Lightning-AI/lightning/actions/runs/3638338139/jobs/6140786615

More info

No response

cc @carmocca @akihironitta @Borda

@akihironitta akihironitta added bug Something isn't working ci Continuous Integration tests app (removed) Generic label for Lightning App package labels Dec 7, 2022
@akihironitta akihironitta changed the title test_app_state_api[MultiProcessRuntime] fails with KeyError: 'flows' in CI test_app_state_api[MultiProcessRuntime] fails with KeyError: 'flows' on macOS in CI Dec 7, 2022
@Borda
Copy link
Member

Borda commented Dec 7, 2022

ok, I saw it a few times too, it is very random and not sure what is happening...
cc: @tchaton @ethanwharris @awaelchli

@tchaton
Copy link
Contributor

tchaton commented Dec 7, 2022

This happens because the server takes some time to setup and the first response is empty. Race condition basically.

@ethanwharris is going to push a fix.

@akihironitta
Copy link
Contributor Author

@tchaton @ethanwharris Would you mind closing this issue if it's resolved?

@ethanwharris
Copy link
Member

Should now be fixed 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app (removed) Generic label for Lightning App package bug Something isn't working ci Continuous Integration tests
Projects
None yet
Development

No branches or pull requests

4 participants