prisma / prisma-test-utils

A collection of data model agnostic test utils.
114 stars 11 forks source link

RangeError: Maximum call stack size exceeded #17

Closed janpio closed 4 years ago

janpio commented 4 years ago

When using prisma-test-utils via prisma-test-utils-automation, some databases (schemas from: https://github.com/prisma/database-schema-examples) fail with this error message:

Error in: concrete5
RangeError: Maximum call stack size exceeded
    at isOrderWellDefinedInPool (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:801:38)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:771:15)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
Error in: magento
RangeError: Maximum call stack size exceeded
    at Function.values (<anonymous>)
    at isOrderWellDefinedInPool (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:802:21)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:771:15)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
Error in: mapos
RangeError: Maximum call stack size exceeded
    at Function.values (<anonymous>)
    at isOrderWellDefinedInPool (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:802:21)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:771:15)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
Error in: northwind
RangeError: Maximum call stack size exceeded
    at Array Iterator.next (<anonymous>)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:768:18)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
Error in: okky
RangeError: Maximum call stack size exceeded
    at Function.values (<anonymous>)
    at isOrderWellDefinedInPool (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:802:21)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:771:15)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
Error in: orangehrm
RangeError: Maximum call stack size exceeded
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
Error in: xpressengine
RangeError: Maximum call stack size exceeded
    at Object.hasOwnProperty (<anonymous>)
    at C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:804:16
    at Array.every (<anonymous>)
    at isOrderWellDefinedInPool (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:802:45)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:771:15)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
janpio commented 4 years ago

PostgreSQL:

Error in: canvas-lms
RangeError: Maximum call stack size exceeded
    at Function.values (<anonymous>)
    at isOrderWellDefinedInPool (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:802:21)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:771:15)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
Error in: mastodon
RangeError: Maximum call stack size exceeded
    at Array Iterator.next (<anonymous>)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:768:18)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
    at sort (C:\Users\Jan\Documents\prisma-test-utils\src\static\seed.ts:788:20)
janpio commented 4 years ago

Theory

Many tables lead to much sorting

Data

mysql:

postgres:

Conclusion

Not really that many tables. Possibly many FK relations? Difficult to figure out.

maticzav commented 4 years ago

@janpio this should be fixed in the latest commit.