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

(app) Resolve a bug where the state changes isn't detected properly #14465

Merged
merged 20 commits into from
Sep 12, 2022

Conversation

tchaton
Copy link
Contributor

@tchaton tchaton commented Aug 31, 2022

What does this PR do?

The DeepDiff generates an unprocessed key for Path, Drive objects and therefore leads to wrong detection of state update. This PR converts Drive, Path objects to dict for DeepDiff to make a comparaison.

The test breaks on master.

___________________________________ test_lightning_app_has_updated ____________________________________

    def test_lightning_app_has_updated():
        app = TestLightningHasUpdatedApp(FlowPath())
>       MultiProcessRuntime(app, start_server=False).dispatch()

tests/tests_app/core/test_lightning_app.py:997: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/lightning_app/runners/multiprocess.py:103: in dispatch
    self.app._run()
src/lightning_app/core/app.py:427: in _run
    done = self.run_once()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tests_app.core.test_lightning_app.TestLightningHasUpdatedApp object at 0x13ceae250>

    def run_once(self):
        res = super().run_once()
        if self.root.w.path is not None:
            self.counter += 1
    
        if self.counter == 2:
>           assert not self._has_updated
E           assert not True
E            +  where True = <tests_app.core.test_lightning_app.TestLightningHasUpdatedApp object at 0x13ceae250>._has_updated

tests/tests_app/core/test_lightning_app.py:990: AssertionError

Fixes #<issue_number>

Does your PR introduce any breaking changes? If yes, please list them.

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

cc @Borda

@tchaton tchaton self-assigned this Aug 31, 2022
@tchaton tchaton added app (removed) Generic label for Lightning App package bug Something isn't working labels Aug 31, 2022
@tchaton tchaton modified the milestones: app:0.6, app:0.6.x Aug 31, 2022
@tchaton tchaton changed the title (app) Resolve a bug where the state changes is detected properly (app) Resolve a bug where the state changes isn't detected properly Aug 31, 2022
src/lightning_app/core/app.py Outdated Show resolved Hide resolved
@mergify mergify bot added the ready PRs ready to be merged label Aug 31, 2022
@mergify mergify bot added the has conflicts label Sep 7, 2022
@mergify mergify bot removed the ready PRs ready to be merged label Sep 7, 2022
@Borda Borda enabled auto-merge (squash) September 7, 2022 08:50
@mergify mergify bot added ready PRs ready to be merged and removed has conflicts ready PRs ready to be merged labels Sep 7, 2022
@mergify mergify bot added has conflicts and removed ready PRs ready to be merged labels Sep 12, 2022
@mergify mergify bot added ready PRs ready to be merged and removed has conflicts ready PRs ready to be merged labels Sep 12, 2022
@Borda Borda merged commit b679fc2 into master Sep 12, 2022
@Borda Borda deleted the resolve_has_update_bug branch September 12, 2022 16:54
krshrimali pushed a commit that referenced this pull request Sep 16, 2022
@krshrimali krshrimali mentioned this pull request Sep 16, 2022
12 tasks
lexierule pushed a commit that referenced this pull request Sep 19, 2022
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 ready PRs ready to be merged
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants