What are you really trying to do?
I'm running workflow tests using the Temporal TypeScript SDK. The test output is littered with warning messages from the Core SDK like this:
2022-07-27T08:21:22.605721Z WARN temporal_sdk_core::worker::workflow::workflow_stream: WFT poller died, shutting down
This is making the test output really hard to read, e.g.
> yarn test test/workflows/executeFullScan_test.ts
yarn run v1.22.18
$ NODE_ENV=test mocha test/workflows/executeFullScan_test.ts
choma: to re-use this ordering, run tests with CHOMA_SEED=IonALwEbIv
workflows
executeFullScan
2022-07-27T08:23:55.738759Z WARN temporal_sdk_core::worker::workflow::workflow_stream: WFT poller died, shutting down
2022-07-27T08:23:55.754344Z WARN temporal_sdk_core::worker::workflow::workflow_stream: WFT poller died, shutting down
✔ paginates the source and inspects each page (1342ms)
2022-07-27T08:23:56.436774Z WARN temporal_sdk_core::worker::workflow::workflow_stream: WFT poller died, shutting down
2022-07-27T08:23:56.452200Z WARN temporal_sdk_core::worker::workflow::workflow_stream: WFT poller died, shutting down
✔ syncs insights after all pages are processed (697ms)
queries
progress
2022-07-27T08:23:57.223656Z WARN temporal_sdk_core::worker::workflow::workflow_stream: WFT poller died, shutting down
2022-07-27T08:23:57.241008Z WARN temporal_sdk_core::worker::workflow::workflow_stream: WFT poller died, shutting down
✔ returns the workflow's progress (797ms)
3 passing (3s)
✨ Done in 5.55s.
I'm trying to suppress that warning from the Core SDK, but have been unable to do so.
Describe the bug
In setting up my test env, I'm installing a custom logger into the Core SDK runtime, and with the log level set to ERROR:
import { TestWorkflowEnvironment } from '@temporalio/testing'
import { DefaultLogger, Runtime, NativeConnection } from '@temporalio/worker'
import { WorkflowClient } from '@temporalio/client'
let testEnv: TestWorkflowEnvironment
export let testClient: WorkflowClient
export let testConnection: NativeConnection
global.before('Create Test Environment', async () => {
const logger = new DefaultLogger('ERROR')
Runtime.install({ logger })
testEnv = await TestWorkflowEnvironment.create({
testServer: {
stdio: 'ignore',
// stdio: 'inherit'
},
logger
})
testConnection = testEnv.nativeConnection
testClient = testEnv.workflowClient
})
global.after('Tear Down Test Environment', () => {
return testEnv?.teardown()
})
To test my workflows, I create a bunch of workers running different (mock) activites and then run them all using the runUntil function, e.g.
await insights.runUntil(() => {
return inspection.runUntil(() => {
return connector.runUntil(() => {
return orchestrator.runUntil(() => {
return testClient.execute(executeFullScan, {
args: [...],
workflowId: 'test-workflow',
taskQueue: orchestrator.options.taskQueue
})
})
})
})
})
The warnings are created when each of these workers shuts down.
Minimal Reproduction
https://github.com/jhecking/samples-typescript/pull/1
That PR adds a simple workflow test to the hello-world sample, which – when run – demonstrates the warning message generated by the Core SDK:
> yarn test
yarn run v1.22.18
$ ts-node src/test.ts
2022-07-27T08:44:04.290368Z WARN temporal_sdk_core::worker::workflow::workflow_stream: WFT poller died, shutting down
✨ Done in 2.67s.
Environment/Versions
- OS and processor: macOS on x86
- Temporal Version: Temporal TypeScript SDK v1.0.0
- Are you using Docker or Kubernetes or building Temporal from source? Doesn't apply since this issue occurs when running unit tests without any Temporal server.
Additional context
https://temporalio.slack.com/archives/C01DKSMU94L/p1658892545849429
bug