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

Add a time comparison between mysql:8.0 and vitess/vttestserver:mysql80 over relationMode = "prisma" tests. #16099

Closed
jkomyno opened this issue Nov 2, 2022 · 5 comments
Assignees
Labels
kind/tech A technical change. team/schema Issue for team Schema. topic: database/vitess topic: internal topic: relationMode formerly `referentialIntegrity`

Comments

@jkomyno
Copy link
Contributor

jkomyno commented Nov 2, 2022

In #16051, we have noticed Vitess is notably slower than other databases when running the relationMode test suites. We thus want to compare the time taken by the MySQL image we use (mysql:8.0) and the Vitess image we use (vitess/vttestserver:mysql80) to complete those tests.

We should:

  • run a test suite that mirrors the tests and content of the relationMode functional suite, but supporting mysql and vitess only, ideally something like the following:
    RELATION_MODE="prisma" PROVIDER_FLAVOR="vitess-8" pnpm run test:functional:code --relation-mode-tests-only relationMode
  • exposes commands to run the test suite with a single database
  • call the Github Actions workflow as client-relationMode-prisma-mysql-vs-vitess
@jkomyno jkomyno self-assigned this Nov 2, 2022
@Jolg42 Jolg42 added topic: internal kind/tech A technical change. team/schema Issue for team Schema. topic: database/vitess topic: relationMode formerly `referentialIntegrity` labels Nov 2, 2022
@janpio
Copy link
Member

janpio commented Nov 2, 2022

(Manual run of this would be fine as well - no need to spend time on GH Actions)
(Manual setup of this by temporarily commenting out other databases and variants also might be enough if our test setup allows that)

@jkomyno
Copy link
Contributor Author

jkomyno commented Nov 2, 2022

I have run the 1:1 relationMode test suite with the command

RELATION_MODE=prisma pnpm run test:functional:code --relation-mode-tests-only relationMode/tests_1-to-1.ts

on a MacBook Pro M1. This command was run 10s after bootstrapping the database instance (either Vitess / MySQL).
Here are the results:

TL/DR

  • mysql:8.0 takes 12.829s
  • vitess/vttestserver:mysql80 takes 599.321s

Output

Vitess

❯ RELATION_MODE=prisma pnpm run test:functional:code --relation-mode-tests-only relationMode/tests_1-to-1.ts > vitess-1-to-1.txt
PASS tests/functional/relationMode/tests_1-to-1.ts (599.321 s)
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=vitess_8,onUpdate=DEFAULT,onDelete=DEFAULT,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        ✓ relationMode=prisma [create] child with non existing parent should succeed (133 ms)
        ✓ [create] child with undefined parent should throw with type error (243 ms)
        ✓ [create] nested child [create] should succeed (60 ms)
        ✓ relationMode=prisma [create] child with non existing parent should succeed (79 ms)
        ✓ [create] child with undefined parent should throw with type error (30 ms)
        ✓ [create] nested child [create] should succeed (53 ms)
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        ✓ [update] (user) optional boolean field should succeed (122 ms)
        ✓ [update] (profile) optional boolean field should succeed (109 ms)
        ✓ [update] (user) optional boolean field should succeed (150 ms)
        ✓ [update] (profile) optional boolean field should succeed (113 ms)
        mutate id tests (skipped only for MongoDB)
          ✓ [upsert] child id with non-existing id should succeed (95 ms)
          ✓ [update] child id with non-existing id should succeed (101 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (127 ms)
          ✓ [update] nested child [update] should succeed (130 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (125 ms)
          ✓ [upsert] child id with non-existing id should succeed (87 ms)
          ✓ [update] child id with non-existing id should succeed (97 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (106 ms)
          ✓ [update] nested child [update] should succeed (102 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (81 ms)
          onUpdate: DEFAULT, Cascade
            ✓ [update] parent id with non-existing id should succeed (102 ms)
            ✓ [updateMany] parent id should succeed (112 ms)
            ✓ [update] parent id with non-existing id should succeed (95 ms)
            ✓ [updateMany] parent id should succeed (101 ms)
          onUpdate: Restrict, NoAction
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            ✓ [update] parent id with existing id should throw (127 ms)
            ✓ [updateMany] parent id with existing id should throw (97 ms)
            ✓ [update] child id with existing id should throw (98 ms)
            ✓ [update] nested child [disconnect] should throw (93 ms)
            ✓ [update] parent id with existing id should throw (87 ms)
            ✓ [updateMany] parent id with existing id should throw (86 ms)
            ✓ [update] child id with existing id should throw (85 ms)
            ✓ [update] nested child [disconnect] should throw (72 ms)
      [delete]
        ✓ [delete] child should succeed (95 ms)
        ✓ [delete] child and then [delete] parent should succeed (104 ms)
        ✓ [delete] child should succeed (93 ms)
        ✓ [delete] child and then [delete] parent should succeed (101 ms)
        onDelete: DEFAULT, Restrict, NoAction
          ✓ [delete] parent should throw (76 ms)
          ✓ [deleteMany] parents should throw (79 ms)
          ✓ [delete] parent should throw (83 ms)
          ✓ [deleteMany] parents should throw (82 ms)
        onDelete: SetNull
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          ○ skipped [delete] parent should succeed
          ○ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=vitess_8,onUpdate=Cascade,onDelete=Cascade,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        ✓ relationMode=prisma [create] child with non existing parent should succeed (72 ms)
        ✓ [create] child with undefined parent should throw with type error (28 ms)
        ✓ [create] nested child [create] should succeed (48 ms)
        ✓ relationMode=prisma [create] child with non existing parent should succeed (81 ms)
        ✓ [create] child with undefined parent should throw with type error (41 ms)
        ✓ [create] nested child [create] should succeed (63 ms)
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        ✓ [update] (user) optional boolean field should succeed (108 ms)
        ✓ [update] (profile) optional boolean field should succeed (129 ms)
        ✓ [update] (user) optional boolean field should succeed (143 ms)
        ✓ [update] (profile) optional boolean field should succeed (133 ms)
        mutate id tests (skipped only for MongoDB)
          ✓ [upsert] child id with non-existing id should succeed (113 ms)
          ✓ [update] child id with non-existing id should succeed (90 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (120 ms)
          ✓ [update] nested child [update] should succeed (112 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (84 ms)
          ✓ [upsert] child id with non-existing id should succeed (118 ms)
          ✓ [update] child id with non-existing id should succeed (116 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (143 ms)
          ✓ [update] nested child [update] should succeed (129 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (80 ms)
          onUpdate: DEFAULT, Cascade
            ✓ [update] parent id with non-existing id should succeed (100 ms)
            ✓ [updateMany] parent id should succeed (101 ms)
            ✓ [update] parent id with non-existing id should succeed (120 ms)
            ✓ [updateMany] parent id should succeed (108 ms)
          onUpdate: Restrict, NoAction
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            ○ skipped [update] parent id with existing id should throw
            ○ skipped [updateMany] parent id with existing id should throw
            ○ skipped [update] child id with existing id should throw
            ○ skipped [update] nested child [disconnect] should throw
            ○ skipped [update] parent id with existing id should throw
            ○ skipped [updateMany] parent id with existing id should throw
            ○ skipped [update] child id with existing id should throw
            ○ skipped [update] nested child [disconnect] should throw
      [delete]
        ✓ [delete] child should succeed (95 ms)
        ✓ [delete] child and then [delete] parent should succeed (102 ms)
        ✓ [delete] child should succeed (115 ms)
        ✓ [delete] child and then [delete] parent should succeed (132 ms)
        onDelete: DEFAULT, Restrict, NoAction
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
        onDelete: SetNull
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          ✓ [delete] parent should succeed (103 ms)
          ✓ [delete] parent should succeed (116 ms)
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=vitess_8,onUpdate=NoAction,onDelete=NoAction,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        ✓ relationMode=prisma [create] child with non existing parent should succeed (73 ms)
        ✓ [create] child with undefined parent should throw with type error (29 ms)
        ✓ [create] nested child [create] should succeed (48 ms)
        ✓ relationMode=prisma [create] child with non existing parent should succeed (73 ms)
        ✓ [create] child with undefined parent should throw with type error (37 ms)
        ✓ [create] nested child [create] should succeed (78 ms)
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        ✓ [update] (user) optional boolean field should succeed (110 ms)
        ✓ [update] (profile) optional boolean field should succeed (97 ms)
        ✓ [update] (user) optional boolean field should succeed (137 ms)
        ✓ [update] (profile) optional boolean field should succeed (99 ms)
        mutate id tests (skipped only for MongoDB)
          ✓ [upsert] child id with non-existing id should succeed (87 ms)
          ✓ [update] child id with non-existing id should succeed (83 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (111 ms)
          ✓ [update] nested child [update] should succeed (101 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (84 ms)
          ✓ [upsert] child id with non-existing id should succeed (85 ms)
          ✓ [update] child id with non-existing id should succeed (84 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (112 ms)
          ✓ [update] nested child [update] should succeed (132 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (94 ms)
          onUpdate: DEFAULT, Cascade
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            ✓ [update] parent id with non-existing id should throw (81 ms)
            ✓ [updateMany] parent id with non-existing id should throw (81 ms)
            ✓ [update] parent id with non-existing id should throw (119 ms)
            ✓ [updateMany] parent id with non-existing id should throw (108 ms)
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            ✓ [update] parent id with existing id should throw (83 ms)
            ✓ [updateMany] parent id with existing id should throw (81 ms)
            ✓ [update] child id with existing id should throw (85 ms)
            ✓ [update] nested child [disconnect] should throw (75 ms)
            ✓ [update] parent id with existing id should throw (104 ms)
            ✓ [updateMany] parent id with existing id should throw (94 ms)
            ✓ [update] child id with existing id should throw (85 ms)
            ✓ [update] nested child [disconnect] should throw (81 ms)
      [delete]
        ✓ [delete] child should succeed (92 ms)
        ✓ [delete] child and then [delete] parent should succeed (100 ms)
        ✓ [delete] child should succeed (101 ms)
        ✓ [delete] child and then [delete] parent should succeed (123 ms)
        onDelete: DEFAULT, Restrict, NoAction
          ✓ [delete] parent should throw (75 ms)
          ✓ [deleteMany] parents should throw (78 ms)
          ✓ [delete] parent should throw (108 ms)
          ✓ [deleteMany] parents should throw (96 ms)
        onDelete: SetNull
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          ○ skipped [delete] parent should succeed
          ○ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=vitess_8,onUpdate=Restrict,onDelete=Restrict,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        ✓ relationMode=prisma [create] child with non existing parent should succeed (67 ms)
        ✓ [create] child with undefined parent should throw with type error (28 ms)
        ✓ [create] nested child [create] should succeed (51 ms)
        ✓ relationMode=prisma [create] child with non existing parent should succeed (77 ms)
        ✓ [create] child with undefined parent should throw with type error (36 ms)
        ✓ [create] nested child [create] should succeed (65 ms)
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        ✓ [update] (user) optional boolean field should succeed (117 ms)
        ✓ [update] (profile) optional boolean field should succeed (103 ms)
        ✓ [update] (user) optional boolean field should succeed (136 ms)
        ✓ [update] (profile) optional boolean field should succeed (117 ms)
        mutate id tests (skipped only for MongoDB)
          ✓ [upsert] child id with non-existing id should succeed (88 ms)
          ✓ [update] child id with non-existing id should succeed (84 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (108 ms)
          ✓ [update] nested child [update] should succeed (104 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (96 ms)
          ✓ [upsert] child id with non-existing id should succeed (104 ms)
          ✓ [update] child id with non-existing id should succeed (132 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (139 ms)
          ✓ [update] nested child [update] should succeed (131 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (106 ms)
          onUpdate: DEFAULT, Cascade
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            ✓ [update] parent id with non-existing id should throw (93 ms)
            ✓ [updateMany] parent id with non-existing id should throw (91 ms)
            ✓ [update] parent id with non-existing id should throw (104 ms)
            ✓ [updateMany] parent id with non-existing id should throw (108 ms)
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            ✓ [update] parent id with existing id should throw (83 ms)
            ✓ [updateMany] parent id with existing id should throw (84 ms)
            ✓ [update] child id with existing id should throw (80 ms)
            ✓ [update] nested child [disconnect] should throw (71 ms)
            ✓ [update] parent id with existing id should throw (121 ms)
            ✓ [updateMany] parent id with existing id should throw (100 ms)
            ✓ [update] child id with existing id should throw (103 ms)
            ✓ [update] nested child [disconnect] should throw (88 ms)
      [delete]
        ✓ [delete] child should succeed (98 ms)
        ✓ [delete] child and then [delete] parent should succeed (120 ms)
        ✓ [delete] child should succeed (117 ms)
        ✓ [delete] child and then [delete] parent should succeed (129 ms)
        onDelete: DEFAULT, Restrict, NoAction
          ✓ [delete] parent should throw (82 ms)
          ✓ [deleteMany] parents should throw (84 ms)
          ✓ [delete] parent should throw (100 ms)
          ✓ [deleteMany] parents should throw (100 ms)
        onDelete: SetNull
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          ○ skipped [delete] parent should succeed
          ○ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=vitess_8,onUpdate=SetNull,onDelete=SetNull,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        ✓ relationMode=prisma [create] child with non existing parent should succeed (77 ms)
        ✓ [create] child with undefined parent should throw with type error (36 ms)
        ✓ [create] nested child [create] should succeed (61 ms)
        ✓ relationMode=prisma [create] child with non existing parent should succeed (76 ms)
        ✓ [create] child with undefined parent should throw with type error (34 ms)
        ✓ [create] nested child [create] should succeed (55 ms)
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        ✓ [update] (user) optional boolean field should succeed (145 ms)
        ✓ [update] (profile) optional boolean field should succeed (124 ms)
        ✓ [update] (user) optional boolean field should succeed (140 ms)
        ✓ [update] (profile) optional boolean field should succeed (126 ms)
        mutate id tests (skipped only for MongoDB)
          ✓ [upsert] child id with non-existing id should succeed (105 ms)
          ✓ [update] child id with non-existing id should succeed (114 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (132 ms)
          ✓ [update] nested child [update] should succeed (116 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (96 ms)
          ✓ [upsert] child id with non-existing id should succeed (102 ms)
          ✓ [update] child id with non-existing id should succeed (110 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (137 ms)
          ✓ [update] nested child [update] should succeed (123 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (104 ms)
          onUpdate: DEFAULT, Cascade
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            ✓ [update] parent id with existing id should throw (107 ms)
            ✓ [updateMany] parent id with existing id should throw (113 ms)
            ✓ [update] child id with existing id should throw (103 ms)
            ✓ [update] nested child [disconnect] should throw (86 ms)
            ✓ [update] parent id with existing id should throw (113 ms)
            ✓ [updateMany] parent id with existing id should throw (123 ms)
            ✓ [update] child id with existing id should throw (110 ms)
            ✓ [update] nested child [disconnect] should throw (97 ms)
      [delete]
        ✓ [delete] child should succeed (129 ms)
        ✓ [delete] child and then [delete] parent should succeed (128 ms)
        ✓ [delete] child should succeed (125 ms)
        ✓ [delete] child and then [delete] parent should succeed (136 ms)
        onDelete: DEFAULT, Restrict, NoAction
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
        onDelete: SetNull
          ✓ relationMode=prisma / SetNull: [delete] parent should throw (124 ms)
          ✓ relationMode=prisma / SetNull: [deleteMany] parents should throw (115 ms)
          ✓ relationMode=prisma / SetNull: [delete] parent should throw (114 ms)
          ✓ relationMode=prisma / SetNull: [deleteMany] parents should throw (108 ms)
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
        onDelete: Cascade
          ○ skipped [delete] parent should succeed
          ○ skipped [delete] parent should succeed

Test Suites: 1 passed, 1 total
Tests:       94 skipped, 186 passed, 280 total
Snapshots:   0 total
Time:        599.355 s
Ran all test suites matching /relationMode\/tests_1-to-1.ts/i.

MySQL

❯ RELATION_MODE=prisma pnpm run test:functional:code --relation-mode-tests-only relationMode/tests_1-to-1.ts > mysql-1-to-1.txt
PASS tests/functional/relationMode/tests_1-to-1.ts (12.829 s)
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=mysql,onUpdate=DEFAULT,onDelete=DEFAULT,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        ✓ relationMode=prisma [create] child with non existing parent should succeed (50 ms)
        ✓ [create] child with undefined parent should throw with type error (192 ms)
        ✓ [create] nested child [create] should succeed (22 ms)
        ✓ relationMode=prisma [create] child with non existing parent should succeed (35 ms)
        ✓ [create] child with undefined parent should throw with type error (14 ms)
        ✓ [create] nested child [create] should succeed (21 ms)
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        ✓ [update] (user) optional boolean field should succeed (49 ms)
        ✓ [update] (profile) optional boolean field should succeed (44 ms)
        ✓ [update] (user) optional boolean field should succeed (46 ms)
        ✓ [update] (profile) optional boolean field should succeed (40 ms)
        mutate id tests (skipped only for MongoDB)
          ✓ [upsert] child id with non-existing id should succeed (44 ms)
          ✓ [update] child id with non-existing id should succeed (49 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (50 ms)
          ✓ [update] nested child [update] should succeed (47 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (33 ms)
          ✓ [upsert] child id with non-existing id should succeed (39 ms)
          ✓ [update] child id with non-existing id should succeed (45 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (57 ms)
          ✓ [update] nested child [update] should succeed (45 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (38 ms)
          onUpdate: DEFAULT, Cascade
            ✓ [update] parent id with non-existing id should succeed (58 ms)
            ✓ [updateMany] parent id should succeed (65 ms)
            ✓ [update] parent id with non-existing id should succeed (41 ms)
            ✓ [updateMany] parent id should succeed (42 ms)
          onUpdate: Restrict, NoAction
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            ✓ [update] parent id with existing id should throw (46 ms)
            ✓ [updateMany] parent id with existing id should throw (49 ms)
            ✓ [update] child id with existing id should throw (39 ms)
            ✓ [update] nested child [disconnect] should throw (33 ms)
            ✓ [update] parent id with existing id should throw (37 ms)
            ✓ [updateMany] parent id with existing id should throw (34 ms)
            ✓ [update] child id with existing id should throw (41 ms)
            ✓ [update] nested child [disconnect] should throw (31 ms)
      [delete]
        ✓ [delete] child should succeed (41 ms)
        ✓ [delete] child and then [delete] parent should succeed (51 ms)
        ✓ [delete] child should succeed (53 ms)
        ✓ [delete] child and then [delete] parent should succeed (57 ms)
        onDelete: DEFAULT, Restrict, NoAction
          ✓ [delete] parent should throw (48 ms)
          ✓ [deleteMany] parents should throw (43 ms)
          ✓ [delete] parent should throw (44 ms)
          ✓ [deleteMany] parents should throw (36 ms)
        onDelete: SetNull
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          ○ skipped [delete] parent should succeed
          ○ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=mysql,onUpdate=Cascade,onDelete=Cascade,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        ✓ relationMode=prisma [create] child with non existing parent should succeed (41 ms)
        ✓ [create] child with undefined parent should throw with type error (13 ms)
        ✓ [create] nested child [create] should succeed (20 ms)
        ✓ relationMode=prisma [create] child with non existing parent should succeed (35 ms)
        ✓ [create] child with undefined parent should throw with type error (14 ms)
        ✓ [create] nested child [create] should succeed (21 ms)
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        ✓ [update] (user) optional boolean field should succeed (50 ms)
        ✓ [update] (profile) optional boolean field should succeed (40 ms)
        ✓ [update] (user) optional boolean field should succeed (46 ms)
        ✓ [update] (profile) optional boolean field should succeed (49 ms)
        mutate id tests (skipped only for MongoDB)
          ✓ [upsert] child id with non-existing id should succeed (41 ms)
          ✓ [update] child id with non-existing id should succeed (38 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (48 ms)
          ✓ [update] nested child [update] should succeed (46 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (35 ms)
          ✓ [upsert] child id with non-existing id should succeed (42 ms)
          ✓ [update] child id with non-existing id should succeed (41 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (53 ms)
          ✓ [update] nested child [update] should succeed (40 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (33 ms)
          onUpdate: DEFAULT, Cascade
            ✓ [update] parent id with non-existing id should succeed (41 ms)
            ✓ [updateMany] parent id should succeed (43 ms)
            ✓ [update] parent id with non-existing id should succeed (42 ms)
            ✓ [updateMany] parent id should succeed (45 ms)
          onUpdate: Restrict, NoAction
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            ○ skipped [update] parent id with existing id should throw
            ○ skipped [updateMany] parent id with existing id should throw
            ○ skipped [update] child id with existing id should throw
            ○ skipped [update] nested child [disconnect] should throw
            ○ skipped [update] parent id with existing id should throw
            ○ skipped [updateMany] parent id with existing id should throw
            ○ skipped [update] child id with existing id should throw
            ○ skipped [update] nested child [disconnect] should throw
      [delete]
        ✓ [delete] child should succeed (39 ms)
        ✓ [delete] child and then [delete] parent should succeed (50 ms)
        ✓ [delete] child should succeed (43 ms)
        ✓ [delete] child and then [delete] parent should succeed (47 ms)
        onDelete: DEFAULT, Restrict, NoAction
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
        onDelete: SetNull
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          ✓ [delete] parent should succeed (41 ms)
          ✓ [delete] parent should succeed (40 ms)
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=mysql,onUpdate=NoAction,onDelete=NoAction,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        ✓ relationMode=prisma [create] child with non existing parent should succeed (34 ms)
        ✓ [create] child with undefined parent should throw with type error (15 ms)
        ✓ [create] nested child [create] should succeed (22 ms)
        ✓ relationMode=prisma [create] child with non existing parent should succeed (35 ms)
        ✓ [create] child with undefined parent should throw with type error (15 ms)
        ✓ [create] nested child [create] should succeed (20 ms)
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        ✓ [update] (user) optional boolean field should succeed (46 ms)
        ✓ [update] (profile) optional boolean field should succeed (44 ms)
        ✓ [update] (user) optional boolean field should succeed (49 ms)
        ✓ [update] (profile) optional boolean field should succeed (47 ms)
        mutate id tests (skipped only for MongoDB)
          ✓ [upsert] child id with non-existing id should succeed (38 ms)
          ✓ [update] child id with non-existing id should succeed (37 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (55 ms)
          ✓ [update] nested child [update] should succeed (48 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (41 ms)
          ✓ [upsert] child id with non-existing id should succeed (48 ms)
          ✓ [update] child id with non-existing id should succeed (45 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (51 ms)
          ✓ [update] nested child [update] should succeed (43 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (35 ms)
          onUpdate: DEFAULT, Cascade
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            ✓ [update] parent id with non-existing id should throw (35 ms)
            ✓ [updateMany] parent id with non-existing id should throw (36 ms)
            ✓ [update] parent id with non-existing id should throw (36 ms)
            ✓ [updateMany] parent id with non-existing id should throw (34 ms)
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            ✓ [update] parent id with existing id should throw (33 ms)
            ✓ [updateMany] parent id with existing id should throw (68 ms)
            ✓ [update] child id with existing id should throw (40 ms)
            ✓ [update] nested child [disconnect] should throw (41 ms)
            ✓ [update] parent id with existing id should throw (38 ms)
            ✓ [updateMany] parent id with existing id should throw (35 ms)
            ✓ [update] child id with existing id should throw (39 ms)
            ✓ [update] nested child [disconnect] should throw (33 ms)
      [delete]
        ✓ [delete] child should succeed (39 ms)
        ✓ [delete] child and then [delete] parent should succeed (50 ms)
        ✓ [delete] child should succeed (40 ms)
        ✓ [delete] child and then [delete] parent should succeed (51 ms)
        onDelete: DEFAULT, Restrict, NoAction
          ✓ [delete] parent should throw (41 ms)
          ✓ [deleteMany] parents should throw (42 ms)
          ✓ [delete] parent should throw (36 ms)
          ✓ [deleteMany] parents should throw (38 ms)
        onDelete: SetNull
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          ○ skipped [delete] parent should succeed
          ○ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=mysql,onUpdate=Restrict,onDelete=Restrict,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        ✓ relationMode=prisma [create] child with non existing parent should succeed (36 ms)
        ✓ [create] child with undefined parent should throw with type error (15 ms)
        ✓ [create] nested child [create] should succeed (20 ms)
        ✓ relationMode=prisma [create] child with non existing parent should succeed (37 ms)
        ✓ [create] child with undefined parent should throw with type error (15 ms)
        ✓ [create] nested child [create] should succeed (21 ms)
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        ✓ [update] (user) optional boolean field should succeed (49 ms)
        ✓ [update] (profile) optional boolean field should succeed (48 ms)
        ✓ [update] (user) optional boolean field should succeed (55 ms)
        ✓ [update] (profile) optional boolean field should succeed (46 ms)
        mutate id tests (skipped only for MongoDB)
          ✓ [upsert] child id with non-existing id should succeed (41 ms)
          ✓ [update] child id with non-existing id should succeed (39 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (52 ms)
          ✓ [update] nested child [update] should succeed (48 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (40 ms)
          ✓ [upsert] child id with non-existing id should succeed (39 ms)
          ✓ [update] child id with non-existing id should succeed (59 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (52 ms)
          ✓ [update] nested child [update] should succeed (41 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (35 ms)
          onUpdate: DEFAULT, Cascade
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            ✓ [update] parent id with non-existing id should throw (36 ms)
            ✓ [updateMany] parent id with non-existing id should throw (34 ms)
            ✓ [update] parent id with non-existing id should throw (36 ms)
            ✓ [updateMany] parent id with non-existing id should throw (36 ms)
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            ✓ [update] parent id with existing id should throw (36 ms)
            ✓ [updateMany] parent id with existing id should throw (38 ms)
            ✓ [update] child id with existing id should throw (36 ms)
            ✓ [update] nested child [disconnect] should throw (30 ms)
            ✓ [update] parent id with existing id should throw (33 ms)
            ✓ [updateMany] parent id with existing id should throw (34 ms)
            ✓ [update] child id with existing id should throw (38 ms)
            ✓ [update] nested child [disconnect] should throw (32 ms)
      [delete]
        ✓ [delete] child should succeed (42 ms)
        ✓ [delete] child and then [delete] parent should succeed (49 ms)
        ✓ [delete] child should succeed (48 ms)
        ✓ [delete] child and then [delete] parent should succeed (58 ms)
        onDelete: DEFAULT, Restrict, NoAction
          ✓ [delete] parent should throw (46 ms)
          ✓ [deleteMany] parents should throw (43 ms)
          ✓ [delete] parent should throw (41 ms)
          ✓ [deleteMany] parents should throw (43 ms)
        onDelete: SetNull
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped relationMode=prisma / SetNull: [delete] parent should throw
          ○ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          ○ skipped [delete] parent should succeed
          ○ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=mysql,onUpdate=SetNull,onDelete=SetNull,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        ✓ relationMode=prisma [create] child with non existing parent should succeed (38 ms)
        ✓ [create] child with undefined parent should throw with type error (14 ms)
        ✓ [create] nested child [create] should succeed (21 ms)
        ✓ relationMode=prisma [create] child with non existing parent should succeed (41 ms)
        ✓ [create] child with undefined parent should throw with type error (17 ms)
        ✓ [create] nested child [create] should succeed (21 ms)
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        ○ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        ✓ [update] (user) optional boolean field should succeed (42 ms)
        ✓ [update] (profile) optional boolean field should succeed (40 ms)
        ✓ [update] (user) optional boolean field should succeed (45 ms)
        ✓ [update] (profile) optional boolean field should succeed (45 ms)
        mutate id tests (skipped only for MongoDB)
          ✓ [upsert] child id with non-existing id should succeed (43 ms)
          ✓ [update] child id with non-existing id should succeed (39 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (48 ms)
          ✓ [update] nested child [update] should succeed (45 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (40 ms)
          ✓ [upsert] child id with non-existing id should succeed (48 ms)
          ✓ [update] child id with non-existing id should succeed (45 ms)
          ✓ [update] nested child [connect] child should succeed if the relationship didn't exist (56 ms)
          ✓ [update] nested child [update] should succeed (47 ms)
          ✓ [update] nested child [connect] should succeed if the relationship already existed (37 ms)
          onUpdate: DEFAULT, Cascade
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
            ○ skipped [update] parent id with non-existing id should succeed
            ○ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
            ○ skipped [update] parent id with non-existing id should throw
            ○ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            ✓ [update] parent id with existing id should throw (53 ms)
            ✓ [updateMany] parent id with existing id should throw (49 ms)
            ✓ [update] child id with existing id should throw (37 ms)
            ✓ [update] nested child [disconnect] should throw (32 ms)
            ✓ [update] parent id with existing id should throw (44 ms)
            ✓ [updateMany] parent id with existing id should throw (46 ms)
            ✓ [update] child id with existing id should throw (38 ms)
            ✓ [update] nested child [disconnect] should throw (33 ms)
      [delete]
        ✓ [delete] child should succeed (45 ms)
        ✓ [delete] child and then [delete] parent should succeed (52 ms)
        ✓ [delete] child should succeed (42 ms)
        ✓ [delete] child and then [delete] parent should succeed (51 ms)
        onDelete: DEFAULT, Restrict, NoAction
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
        onDelete: SetNull
          ✓ relationMode=prisma / SetNull: [delete] parent should throw (51 ms)
          ✓ relationMode=prisma / SetNull: [deleteMany] parents should throw (45 ms)
          ✓ relationMode=prisma / SetNull: [delete] parent should throw (52 ms)
          ✓ relationMode=prisma / SetNull: [deleteMany] parents should throw (48 ms)
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
          ○ skipped [delete] parent should throw
          ○ skipped [deleteMany] parents should throw
        onDelete: Cascade
          ○ skipped [delete] parent should succeed
          ○ skipped [delete] parent should succeed

Test Suites: 1 passed, 1 total
Tests:       94 skipped, 186 passed, 280 total
Snapshots:   0 total
Time:        12.857 s, estimated 600 s
Ran all test suites matching /relationMode\/tests_1-to-1.ts/i.

@janpio
Copy link
Member

janpio commented Nov 2, 2022

(Something is off with that 600s, the actual steps are "only" 2.5 times slower)

@Jolg42
Copy link
Member

Jolg42 commented Nov 3, 2022

It could be that it's the creation and deletion of the database/tables that is very slow, which is not reflected in the step time.

@jkomyno
Copy link
Contributor Author

jkomyno commented Nov 8, 2022

Closing this as the time comparison has been pasted into the comments above.

@jkomyno jkomyno closed this as completed Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/tech A technical change. team/schema Issue for team Schema. topic: database/vitess topic: internal topic: relationMode formerly `referentialIntegrity`
Projects
None yet
Development

No branches or pull requests

3 participants