<commit_before>import testMatrix from './_matrix'
// @ts-ignore
import type { Prisma, PrismaClient, Tag } from './node_modules/@prisma/client'

declare let prisma: PrismaClient

// https://github.com/prisma/prisma/issues/8832
testMatrix.setupTestSuite(
  () => {
    async function createTags(length: number): Promise<number[]> {
      const ids = Array.from({ length }, (_, i) => i + 1)
      const data = ids.map((id) => ({ id }))
      await prisma.tag.createMany({
        data,
      })
      return ids
    }

    async function getTagsFindManyIn(ids: number[]): Promise<Tag[]> {
      const tags = await prisma.tag.findMany({
        where: {
          id: {
            in: ids,
          },
        },
      })
      return tags
    }

    async function getTagsFindManyInclude(): Promise<Tag[]> {
      const tags = await prisma.tag.findMany({
        include: {
          posts: true,
        },
      })
      return tags
    }

    async function clean() {
      const cleanPrismaPromises = [prisma.tagsOnPosts.deleteMany(), prisma.post.deleteMany(), prisma.tag.deleteMany()]
      for (const promise of cleanPrismaPromises) {
        await promise
      }
    }

    describe('issue #8832', () => {
      beforeEach(async () => {
        await clean()
      }, 30_000)

      test('should succeed when "in" has 32766 ids', async () => {
        const n = 32766
        const ids = await createTags(n)
        const tags = await getTagsFindManyIn(ids)

        expect(tags.length).toBe(n)
      })
<commit_msg>test(client): increase 8832 test timeout (#15756)<commit_after>import testMatrix from './_matrix'
// @ts-ignore
import type { Prisma, PrismaClient, Tag } from './node_modules/@prisma/client'

declare let prisma: PrismaClient

// https://github.com/prisma/prisma/issues/8832
testMatrix.setupTestSuite(
  () => {
    async function createTags(length: number): Promise<number[]> {
      const ids = Array.from({ length }, (_, i) => i + 1)
      const data = ids.map((id) => ({ id }))
      await prisma.tag.createMany({
        data,
      })
      return ids
    }

    async function getTagsFindManyIn(ids: number[]): Promise<Tag[]> {
      const tags = await prisma.tag.findMany({
        where: {
          id: {
            in: ids,
          },
        },
      })
      return tags
    }

    async function getTagsFindManyInclude(): Promise<Tag[]> {
      const tags = await prisma.tag.findMany({
        include: {
          posts: true,
        },
      })
      return tags
    }

    async function clean() {
      const cleanPrismaPromises = [prisma.tagsOnPosts.deleteMany(), prisma.post.deleteMany(), prisma.tag.deleteMany()]
      for (const promise of cleanPrismaPromises) {
        await promise
      }
    }

    describe('issue #8832', () => {
      beforeEach(async () => {
        await clean()
      }, 60_000)

      test('should succeed when "in" has 32766 ids', async () => {
        const n = 32766
        const ids = await createTags(n)
        const tags = await getTagsFindManyIn(ids)

        expect(tags.length).toBe(n)
      })

{'fraction_non_alphanumeric': 0.13497728747566515, 'fraction_numerical': 0.018494484101232965, 'mean_word_length': 2.1981327800829877, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6536369', 'n_tokens_mistral': 1010, 'n_tokens_neox': 931, 'n_words': 221}