Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Oct 8, 2025

Fixes #123

Summary

Adds an e2e test to reproduce the async function compilation hang reported in issue #123. However, the issue cannot be reproduced in the current codebase - compilation with async function handlers co
mpletes successfully.

Issue Description

@cpursley reported that compilation would hang when using async functions in flow step handlers. After removing the async keywords, compilation worked. The problematic pattern was:

.step(
  { slug: 'process_company_logo' },
  async (input) => await processCompanyLogoTask({ ... })
)

Changes Made

  • Test Flow: Added pkgs/cli/examples/async-function-hang.ts - reproduces the exact pattern from the issue with dummy async tasks
  • E2E Test Script: Added pkgs/cli/scripts/test-async-hang-issue-123 - automated test with 30s timeout to detect hangs
  • Nx Target: Added test:e2e:async-hang-issue-123 to pkgs/cli/project.json

Test Results

The test passes successfully, indicating:

  1. Async functions in handlers compile without hanging
  2. The compilation completes in under 30 seconds
  3. Migration files are generated correctly

Possible Explanations

The issue may have been:

  • Fixed by other changes in the codebase
  • Specific to the user's environment or the actual task imports used
  • Related to network issues when Deno was fetching dependencies

The test now provides regression protection if this issue resurfaces.

…r issue #123

- Introduced a new flow example demonstrating async function hang scenario
- Updated project configuration to include a new end-to-end test for async hang issue
- Added a script to reproduce and verify if compilation hangs on flows with async functions
- Enhanced CI pipeline to run the new test, aiding in regression detection for issue #123
@changeset-bot
Copy link

changeset-bot bot commented Oct 8, 2025

⚠️ No Changeset found

Latest commit: f069c93

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor Author

jumski commented Oct 8, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge:queue - adds this PR to the back of the merge queue
  • hotfix:queue - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jumski jumski changed the title chore: add flow example with async functions and update CI to test for issue #123 Add e2e test for async function compilation (issue #123) Oct 8, 2025
@jumski jumski marked this pull request as ready for review October 8, 2025 08:52
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 8, 2025

Merge activity

  • Oct 8, 8:52 AM UTC: jumski added this pull request to the Graphite merge queue.
  • Oct 8, 8:52 AM UTC: CI is running for this pull request on a draft pull request (#239) due to your merge queue CI optimization settings.
  • Oct 8, 8:53 AM UTC: Merged by the Graphite merge queue via draft PR: #239.

@nx-cloud
Copy link

nx-cloud bot commented Oct 8, 2025

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit f069c93

Command Status Duration Result
nx affected -t lint typecheck test --parallel -... ❌ Failed 17s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-08 08:52:44 UTC

graphite-app bot pushed a commit that referenced this pull request Oct 8, 2025
Fixes #123

### Summary
Adds an e2e test to reproduce the async function compilation hang reported in issue #123. However, **the issue cannot be reproduced** in the current codebase - compilation with async function handlers co
mpletes successfully.

### Issue Description
@cpursley reported that compilation would hang when using async functions in flow step handlers. After removing the `async` keywords, compilation worked. The problematic pattern was:

```typescript
.step(
  { slug: 'process_company_logo' },
  async (input) => await processCompanyLogoTask({ ... })
)
```

### Changes Made
- **Test Flow**: Added `pkgs/cli/examples/async-function-hang.ts` - reproduces the exact pattern from the issue with dummy async tasks
- **E2E Test Script**: Added `pkgs/cli/scripts/test-async-hang-issue-123` - automated test with 30s timeout to detect hangs
- **Nx Target**: Added `test:e2e:async-hang-issue-123` to `pkgs/cli/project.json`

### Test Results
The test passes successfully, indicating:
1. Async functions in handlers compile without hanging
2. The compilation completes in under 30 seconds
3. Migration files are generated correctly

### Possible Explanations
The issue may have been:
- Fixed by other changes in the codebase
- Specific to the user's environment or the actual task imports used
- Related to network issues when Deno was fetching dependencies

The test now provides regression protection if this issue resurfaces.
@graphite-app graphite-app bot closed this Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compilation hangs on flow with async functions

2 participants