Problem: Testing Temporal Workflows with Signals in Ruby SDK Time-Skipping Environment
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Reproduce el flujo de trabajo en Temporalio::Testing::WorkflowEnvironment.start_time_skipping usando wait_condition, la señal customer_replied y workflow_handle.result. Traza cómo la entrega de la señal y el salto de tiempo reanudan la ejecución y, después, compara el comportamiento de start_workflow y execute_workflow. Se considera terminado cuando se haya identificado la causa y documentado un enfoque de prueba verificado o un cambio necesario en el SDK.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem: Testing Temporal Workflows with Signals in Ruby SDK Time-Skipping Environment
Context
I'm testing a workflow in the Temporalio Ruby SDK that uses wait_condition to wait for signals. The workflow works correctly in production, but I cannot test the signal-driven continuation in the time-skipping test environment (Temporalio::Testing::WorkflowEnvironment.start_time_skipping).
Workflow Pattern (Simplified)
class PipelineExecutionWorkflow < Temporalio::Workflow
workflow_signal
def customer_replied
@customer_replied = true
end
def execute(opportunity_id, pipeline_id)
# Step 1: Send initial email
send_email_activity(opportunity_id)
# Step 2: Wait for customer reply signal
Temporalio::Workflow.timeout(48.hours) do
Temporalio::Workflow.wait_condition { @customer_replied }
end
# Step 3: Process customer reply (extract data, send AI response)
if @customer_replied
extract_and_respond(opportunity_id)
end
{ "success" => true }
end
end
What I've Tried in Tests
Temporalio::Testing::WorkflowEnvironment.start_time_skipping do |env|
worker = Temporalio::Worker.new(
client: env.client,
task_queue: "test-queue",
workflows: [PipelineExecutionWorkflow],
activities: [SendEmailActivity, ExtractActivity]
)
worker.run do
# Start workflow (doesn't wait for completion)
workflow_handle = env.client.start_workflow(
PipelineExecutionWorkflow,
opportunity_id,
pipeline_id,
id: "test-pipeline-#{opportunity_id}",
task_queue: "test-queue"
)
# Give time for initial email to be sent
sleep 0.5
# Check workflow state - shows it's waiting
state = workflow_handle.query("get_state")
# => {"waiting_for_signal" => true, "customer_replied" => false}
# Send the signal
workflow_handle.signal("customer_replied")
# Check state again - signal was received!
state_after = workflow_handle.query("get_state")
# => {"waiting_for_signal" => false, "customer_replied" => true}
# But when I try to get the result, it times out or returns nil
result = workflow_handle.result # ← TIMES OUT or returns nil
# The workflow doesn't continue executing after receiving the signal
end
end
Observed Behavior
- ✅ Workflow starts successfully
- ✅ Initial email activity executes
- ✅ Workflow enters wait state (
wait_condition) - ✅ Signal is received (verified via query -
@customer_repliedbecomestrue) - ❌ Workflow doesn't continue execution after signal received
- ❌
workflow_handle.resulttimes out or workflow appears "stuck"
Questions
With the Temporal Ruby SDK source code available:
-
Is this a known limitation of the time-skipping test environment with
wait_conditionand signals? -
What is the correct way to test workflows that use
wait_conditionwith signals in the time-skipping environment? -
Should I use a different testing approach for signal-driven workflows? (e.g., real Temporal server, different test helper methods)
-
Is there a way to manually advance time or "wake up" the workflow after sending a signal in the test environment?
-
Are there any special considerations or setup required for testing signal-driven workflows that use
wait_condition?
Additional Context
- Ruby SDK version: 1.0.0 (from Gemfile)
- The workflow works perfectly in production with real Temporal server
- Synchronous workflows (without signals/wait) test fine in time-skipping environment
- I've tried both
start_workflow(non-blocking) andexecute_workflow(blocking) - neither works for the signal continuation
- Lenguaje dominante
- Ruby
- Estrellas
- 207
- Forks
- 44
- Merge medio
- 1 d 14 h
- PR fusionados (30 d)
- 15
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de temporalio/sdk-ruby
-
[Bug] JSON payload decoding raises ArgumentError with json 3.x (JSON.parse options are keyword-only)Posiblemente ocupada @chris-olszewski la tomó hace 9 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
temporalio/sdk-ruby#595 · 3 comentarios · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
Enable concurrent payload visiting - RubyPosiblemente ocupada @jmaeagle99 la tomó hace 2 días. Abierto
temporalio/sdk-ruby#616 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
External Payload Storage Foundation - RubyPosiblemente ocupada @jmaeagle99 la tomó hace 6 días. Abierto
temporalio/sdk-ruby#614 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug] Exception in an unawaited Workflow::Future is silently swallowed, leaving the workflow stuck RUNNINGPosiblemente ocupada @GregoryTravis la tomó hace 2 días. Abiertobug
Dificultad 3/5 Medio día Aptitud para principiantes 40/100
temporalio/sdk-ruby#613 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Proposal: handle SIGTERM by default to initiate graceful worker shutdownPosiblemente ocupada @eamsden la tomó hace 7 días. Abierto
temporalio/sdk-ruby#611 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de temporalio/sdk-ruby
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 7 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 7 días
-
NoMethodError in auth#createAbiertobugsnag
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
JoeMcB/improvcoaches#827 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
TheOdinProject/curriculum#31465 ·
Los mantenedores suelen responder en 1 día
-
area: docs eco: ruby good first issue help wanted lane: free-agent roadmap size: XS type: docs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 66/100
arminazimi/evergreen#465 ·
Los mantenedores suelen responder en 1 día