Test server seems to not enable time skipping in this specific scenario
See original GitHub issueExpected Behavior
W2 7 day timer should be unblocked immediately.
Actual Behavior
Timer is not unblocked.
Steps to Reproduce the Problem
(I have not run this myself and verified, this is pseudo code I got from a user on slack)
async function W1() {
await A1();
...
}
async function A1() {
const ids = runDBQuery();
const { workflowClient } = getContext();
await Promise.all(
ids.map((id) =>
workflowClient.signalWithStart(W2, {
taskQueue: "default",
workflowId: `W2-${id}`,
args: [
{
...
},
],
signal: S1,
signalArgs: [{ ... }],
})
),
);
}
async function W2() {
await sleep("7 days");
await A2();
...
}
async function A2() {
// produce side effect
}
describe("test T1", () => {
it("alls A2", async () => {
const testActivities = {
...activities,
A2: jest.fn(),
};
const testEnv = await TestWorkflowEnvironment.createTimeSkipping();
const worker = await Worker.create({
connection: testEnv.nativeConnection,
workflowsPath: require.resolve("./allWorkflows"),
interceptors: appendDefaultInterceptors(
{
activityInbound: [
(ctx) =>
new CustomActivityInboundInterceptor(ctx, {
workflowClient: testEnv.client.workflow,
}),
],
},
console
),
activities: testActivities,
taskQueue: "default",
});
await worker.runUntil(() =>
testEnv.client.workflow.execute(
W1,
{
workflowId: randomUUID(),
taskQueue: "default",
args: [
{
...
},
],
}
)
)
const handle = testEnv.client.workflow.getHandle(`W2-id1`);
await handle.result();
expect(testActivities.A2).toHaveBeenCalled();
})
})
Issue Analytics
- State:
- Created 9 months ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
How to programmatically skip a test in mocha? - Stack Overflow
The question asks about programmatically skipping tests, so adding ".skip" or ".only" is not helpful. Then it explicitly says you can't do what...
Read more >Dealing With Synchronization Issues in Tests | Detox
We are waiting too much - The test will appear to hang and fail with timeout. This happens because Detox thinks an asynchronous...
Read more >Authoring Tasks - Gradle User Manual
Task has actions, but the task tells Gradle it did not change its outputs. ... configureEach { enabled = false } tasks.register('test') {...
Read more >Configuration File - WebdriverIO
The configuration file contains all necessary information to run your test suite. It's a NodeJS module that exports a JSON.
Read more >Component testing scenarios - Angular
A server takes time to respond and the response certainly won't be available immediately as in the previous two tests. Your tests will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@maxgurewitz Thanks for the clarification, it makes more sense if they wait only for a start. I will try to repro it and get back to you, I don’t expect it to be a Test Server bug, but it may be a TS SDK bug. How many workflows does A1 start in your test? One or several?
Looks like the worker in this example is shut down before the second workflow gets a chance to complete.