Skip to content

๐Ÿ› [Bug] Still Some More Often Appearing Flaky Tests #4572

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

Closed
Tirokk opened this issue Jul 26, 2021 · 0 comments
Closed

๐Ÿ› [Bug] Still Some More Often Appearing Flaky Tests #4572

Tirokk opened this issue Jul 26, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Tirokk
Copy link
Member

Tirokk commented Jul 26, 2021

๐Ÿ› Bug Report

!!! duplicate of #4341

Still some more often appearing flaky tests:

Bildschirmfoto 2021-07-26 um 11 59 02

Bildschirmfoto 2021-07-26 um 11 55 32

Bildschirmfoto 2021-07-26 um 12 52 37

Looks kind of similar โ€ฆ
Can it be that this is related to a bug in Neode?

Additional Information

Can it be that the data base in GitHub Actions has no constraints while testing?
Locally I get this output if there are no constraints:

Summary of all failing tests
 FAIL  src/middleware/slugifyMiddleware.spec.js (14.663s)
  โ— slugifyMiddleware โ€บ CreatePost โ€บ if slug exists โ€บ but if the client specifies a slug โ€บ rejects CreatePost


                  Error: expect(received).resolves.toMatchObject(expected)

    - Expected  - 5
    + Received  + 1

      Object {
    -   "errors": Array [
    -     Object {
    -       "message": "Post with this slug already exists!",
    -     },
    -   ],
    +   "errors": undefined,
      }

                  Probably your database has no unique constraints!

                  To see all constraints go to http://localhost:7474/browser/ and
                  paste the following:
                  ```
                    CALL db.constraints();
                  ```

                  Learn how to setup the database here:
                  https://docs.human-connection.org/human-connection/backend#database-indices-and-constraints

      149 |             done()
      150 |           } catch (error) {
    > 151 |             throw new Error(`
          |                   ^
      152 |               ${error}
      153 |
      154 |               Probably your database has no unique constraints!


      at Object.<anonymous> (src/middleware/slugifyMiddleware.spec.js:151:19)

  โ— slugifyMiddleware โ€บ SignupVerification โ€บ given a user has signed up with their email address โ€บ if slug exists โ€บ but if the client specifies a slug โ€บ rejects SignupVerification (on FAIL Neo4j constraints may not defined in database)

    expect(received).resolves.toMatchObject(expected)

    - Expected  - 5
    + Received  + 1

      Object {
    -   "errors": Array [
    -     Object {
    -       "message": "User with this slug already exists!",
    -     },
    -   ],
    +   "errors": undefined,
      }

      264 |                 variables,
      265 |               }),
    > 266 |             ).resolves.toMatchObject({
          |                        ^
      267 |               errors: [
      268 |                 {
      269 |                   message: 'User with this slug already exists!',

      at Object.toMatchObject (node_modules/expect/build/index.js:234:20)
      at Object.<anonymous> (src/middleware/slugifyMiddleware.spec.js:266:24)

 FAIL  src/schema/resolvers/emails.spec.js
  โ— VerifyEmailAddress โ€บ authenticated โ€บ given a `UnverifiedEmailAddress` โ€บ given valid nonce for `UnverifiedEmailAddress` node โ€บ and the `UnverifiedEmailAddress` belongs to the authenticated user โ€บ Edge case: In the meantime someone created an `EmailAddress` node with the given email โ€บ throws UserInputError because of unique constraints

    expect(received).resolves.toMatchObject(expected)

    - Expected  - 5
    + Received  + 5

      Object {
        "data": Object {
    -     "VerifyEmailAddress": null,
    +     "VerifyEmailAddress": Object {
    +       "createdAt": "2021-10-20T10:59:51.993Z",
    +       "email": "[email protected]",
    +       "verifiedAt": "2021-10-20T10:59:52.006Z",
          },
    -   "errors": Array [
    -     Object {
    -       "message": "A user account with this email already exists.",
        },
    -   ],
    +   "errors": undefined,
      }

      293 |
      294 |             it('throws UserInputError because of unique constraints', async () => {
    > 295 |               await expect(mutate({ mutation, variables })).resolves.toMatchObject({
          |                                                                      ^
      296 |                 data: { VerifyEmailAddress: null },
      297 |                 errors: [{ message: 'A user account with this email already exists.' }],
      298 |               })

      at Object.toMatchObject (node_modules/expect/build/index.js:234:20)
      at Object.<anonymous> (src/schema/resolvers/emails.spec.js:295:70)

 FAIL  src/models/User.spec.js
  โ— slug โ€บ must be unique


            Error: expect(received).rejects.toThrow()

    Received promise resolved instead of rejected
    Resolved to value: {"_deleted": false, "_eager": Map {"emoted" => [Collection]}, "_identity": {"high": 0, "low": 6543}, "_labels": ["User"], "_model": {"_hidden": [Array], "_indexed": [Array], "_labels": [Array], "_name": "User", "_neode": [Neode], "_primary_key": "id", "_properties": [Map], "_readonly": [Array], "_relationships": [Map], "_schema": [Object], "_unique": [Array]}, "_neode": {"_enterprise": false, "driver": [Driver], "factory": [Factory], "models": [ModelMap], "schema": [Schema]}, "_properties": Map {"id" => "9888c23b-9e20-4665-8fe7-4e2df8615d49", "slug" => "matt", "deleted" => false, "disabled" => false, "role" => "user", "createdAt" => "2021-10-20T10:59:52.671Z", "updatedAt" => "2021-10-20T10:59:52.671Z", "allowEmbedIframes" => false, "showShoutsPublicly" => false, "sendNotificationEmails" => true}}

            Probably your database has no unique constraints!

            To see all constraints go to http://localhost:7474/browser/ and
            paste the following:
            ```
              CALL db.constraints();
            ```

            Learn how to setup the database here:
            https://docs.human-connection.org/human-connection/backend#database-indices-and-constraints

      44 |       done()
      45 |     } catch (error) {
    > 46 |       throw new Error(`
         |             ^
      47 |         ${error}
      48 |
      49 |         Probably your database has no unique constraints!


      at Object.<anonymous> (src/models/User.spec.js:46:13)


Test Suites: 3 failed, 42 passed, 45 total
Tests:       4 failed, 1 skipped, 1 todo, 479 passed, 485 total
Snapshots:   0 total
Time:        252.582s, estimated 294s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Additional Informations

Some flaky tests may be related to:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants