Skip to content

Flaky Tests Invalid server state: initialized #9149

Closed
parse-community/Parse-SDK-JS
#2183

Description

@dplewis

New Issue Checklist

Issue Description

The test suite in this repo and in the JS SDK both have flaky tests. I believe this is due to the asyncronous nature of starting the server instance.

await ParseServer.startApp(newConfiguration);

I think the issue is after the promise resolves the server is still initializing. #8232

Parse.Query testing dontSelect query without conditions
  - Unhandled promise rejection: ParseError: 111 Invalid server state: initialized,ParseError: 111 Invalid server state: initialized,ParseError: 111 Invalid server state: initialized,ParseError: 111 Invalid server state: initialized,ParseError: 111 Invalid server state: initialized  

Steps to reproduce

I can't reproduce this locally

Actual Outcome

Tests fail

Expected Outcome

Test Pass

Activity

  1. parse-github-assistant commented on Jun 7, 2024

    @parse-github-assistant

    Thanks for opening this issue!

    • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
  2. added
    type:bugImpaired feature or lacking behavior that is likely assumed
    on Jun 11, 2024
  3. mtrezza commented on Jun 11, 2024

    @mtrezza
    Member

    So initialized is the state after calling the ParseServer constructor. As soon as you call start() on the instance, the state changes to starting. From what you describe it looks like start() has not been called at all, because starting is set synchronously after calling start(). So it may be related to the reconfigureServer logic; that promise may return early, rather than the server init itself. Which would be good, because that means it's only a testing issue, not a server issue.

  4. added
    type:ciCI related issue
    and removed
    type:bugImpaired feature or lacking behavior that is likely assumed
    on Jun 11, 2024
  5. mtrezza commented on Jun 28, 2024

    @mtrezza
    Member
  6. mtrezza commented on Jun 28, 2024

    @mtrezza
    Member

    Re-opened, I think we first need to upgrade the Parse JS SDK in Parse Server to see whether the Parse Server CI shows less flakiness.

  7. dplewis commented on Jun 28, 2024

    @dplewis
    MemberAuthor

    I agree, I still don’t know why this is happening. I would like to think I solved it on the JS SDK

    IMG_0502

  8. mtrezza commented on Jun 30, 2024

    @mtrezza
    Member

    Issue still occurs in recent PRs; I have never seen this before; is this a recently introduced issue?

  9. dplewis commented on Jul 7, 2024

    @dplewis
    MemberAuthor

    @mtrezza Looks like the server shutsdown and restarts randomly after a few hundred tests. If we turn off the randomized tests we should find a pattern.

  10. mtrezza commented on Jul 7, 2024

    @mtrezza
    Member

    Okay, if you want to open a PR to temporarily disable random tests I'll go ahead and merge

  11. parseplatformorg commented on Jul 9, 2024

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 7.2.0-beta.1

  12. parseplatformorg commented on Jul 9, 2024

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 7.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions