-
Notifications
You must be signed in to change notification settings - Fork 68
Fix flaky process model tests wrt data stores #2647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds a required first parameter Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Controller
participant ProcessModelTestRunner
participant current_app as Flask context
participant Delegate
participant KKVDataStore
participant SpiffTask
Controller->>ProcessModelTestRunner: instantiate(process_model_identifier, ...)
Controller->>ProcessModelTestRunner: run()
ProcessModelTestRunner->>current_app: set thread-local/process_model_identifier
ProcessModelTestRunner->>Delegate: delegate.execute_task(spiff_task)
Delegate->>KKVDataStore: add_data_store_getters_to_spiff_task(spiff_task)
KKVDataStore-->>Delegate: getters attached to spiff_task
Delegate->>SpiffTask: execute (with datastore getters & thread-local available)
SpiffTask-->>Delegate: result
Delegate-->>ProcessModelTestRunner: task result
ProcessModelTestRunner-->>Controller: run result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-11-25T14:52:05.543ZApplied to files:
🧬 Code graph analysis (1)spiffworkflow-backend/src/spiffworkflow_backend/services/process_model_test_runner_service.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
burnettk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hot
The test runner was not initializing thread local data like the process instance processor does, so if the current thread local data did not have a process model identifier that allowed the data store's location to be resolved the test would fail. This is why you'd see something like the reported ~70% fail rates on a prod box - likely 1/4 worker threads was initialized as needed.
Also added the kkv getters into task data when using the test runner.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.