🐛 [Bug] Still Some More Often Appearing Flaky Tests
Created by: Tirokk
🐛 Bug Report
!!! duplicate of #4341 (closed)
Still some more often appearing flaky tests:
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": "to-be-verified@example.org",
+ "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: