Report more cleanups from work in progress PRs
[poolifier.git] / tests / worker-files / thread / testWorker.js
index 3556da01f8051960125d833ec4b38e7196f6ad94..ccf55b56ba92d29e3848ecf0d19d37fe39f068e9 100644 (file)
@@ -1,15 +1,14 @@
 'use strict'
-const { ThreadWorker } = require('../../../lib/index')
+const { ThreadWorker, KillBehaviors } = require('../../../lib/index')
 const { isMainThread } = require('worker_threads')
+const TestUtils = require('../../test-utils')
 
 function test (data) {
-  for (let i = 0; i <= 50; i++) {
-    const o = {
-      a: i
-    }
-    JSON.stringify(o)
-  }
+  TestUtils.jsonIntegerSerialization(50)
   return isMainThread
 }
 
-module.exports = new ThreadWorker(test, { maxInactiveTime: 500 })
+module.exports = new ThreadWorker(test, {
+  maxInactiveTime: 500,
+  killBehavior: KillBehaviors.HARD
+})