-import { beforeAll, describe, expect, it } from 'vitest'
+import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import {
DynamicClusterPool,
)
})
+ afterAll(async () => {
+ // Skip on CI to avoid afterAll hook timeout
+ if (process.env.CI != null) return
+ if (pool.info.started && !pool.destroying) {
+ await pool.destroy()
+ }
+ })
+
it('Verify that the function is executed in a worker cluster', async () => {
let result = await pool.execute(
{
})
it('Shutdown test', { retry: 0 }, async ({ skip }) => {
- if (process.env.CI) {
+ if (process.env.CI != null) {
skip()
return
}
})
afterAll(async () => {
+ // Skip on CI to avoid afterAll hook timeout
+ if (process.env.CI != null) return
// We need to clean up the resources after our tests
await echoPool.destroy()
await asyncPool.destroy()
})
it('Shutdown test', { retry: 0 }, async ({ skip }) => {
- if (process.env.CI) {
+ if (process.env.CI != null) {
skip()
return
}
})
afterAll(async () => {
+ // Skip on CI to avoid afterAll hook timeout
+ if (process.env.CI != null) return
await clusterFixedPool.destroy()
await threadFixedPool.destroy()
})
})
afterAll(async () => {
+ // Skip on CI to avoid afterAll hook timeout
+ if (process.env.CI != null) return
await pool.destroy()
})
})
afterAll(async () => {
+ // Skip on CI to avoid afterAll hook timeout
+ if (process.env.CI != null) return
await fixedPool.destroy()
await dynamicPool.destroy()
})
-import { beforeAll, describe, expect, it } from 'vitest'
+import { afterAll, beforeAll, describe, expect, it } from 'vitest'
import {
DynamicThreadPool,
)
})
+ afterAll(async () => {
+ // Skip on CI to avoid afterAll hook timeout
+ if (process.env.CI != null) return
+ if (pool.info.started && !pool.destroying) {
+ await pool.destroy()
+ }
+ })
+
it('Verify that the function is executed in a worker thread', async () => {
let result = await pool.execute(
{
})
it('Shutdown test', { retry: 0 }, async ({ skip }) => {
- if (process.env.CI) {
+ if (process.env.CI != null) {
skip()
return
}
})
afterAll(async () => {
+ // Skip on CI to avoid afterAll hook timeout
+ if (process.env.CI != null) return
// We need to clean up the resources after our tests
await echoPool.destroy()
await asyncPool.destroy()
})
it('Shutdown test', { retry: 0 }, async ({ skip }) => {
- if (process.env.CI) {
+ if (process.env.CI != null) {
skip()
return
}
})
afterAll(async () => {
+ // Skip on CI to avoid afterAll hook timeout
+ if (process.env.CI != null) return
await threadWorkerNode.terminate()
await clusterWorkerNode.terminate()
})
provider: 'v8',
reporter: ['text', 'html', 'lcov'],
thresholds: {
- branches: 75,
+ branches: 80,
functions: 80,
lines: 80,
statements: 80,