@@ -177,12 +177,14 @@ func TestWorkflowQueues(t *testing.T) {
177177 }
178178 })
179179
180+ /* TODO: we will move queue registry in the new interface in a subsequent PR
180181 t.Run("DynamicRegistration", func(t *testing.T) {
181182 q := NewWorkflowQueue("dynamic-queue")
182183 if len(q.name) > 0 {
183184 t.Fatalf("expected nil queue for dynamic registration after DBOS initialization, got %v", q)
184185 }
185186 })
187+ */
186188
187189 t .Run ("QueueWorkflowDLQ" , func (t * testing.T ) {
188190 workflowID := "blocking-workflow-test"
@@ -303,6 +305,11 @@ func TestQueueRecovery(t *testing.T) {
303305 }
304306 RegisterWorkflow (dbosCtx , recoveryWorkflowFunc )
305307
308+ err := dbosCtx .Launch ()
309+ if err != nil {
310+ t .Fatalf ("failed to launch DBOS instance: %v" , err )
311+ }
312+
306313 queuedSteps := 5
307314
308315 for i := range recoveryStepEvents {
@@ -402,7 +409,7 @@ var (
402409)
403410
404411func TestGlobalConcurrency (t * testing.T ) {
405- dbosContext := setupDBOS (t )
412+ dbosCtx := setupDBOS (t )
406413
407414 // Create workflow with dbosContext
408415 globalConcurrencyWorkflowFunc := func (ctx DBOSContext , input string ) (string , error ) {
@@ -415,15 +422,20 @@ func TestGlobalConcurrency(t *testing.T) {
415422 }
416423 return input , nil
417424 }
418- RegisterWorkflow (dbosContext , globalConcurrencyWorkflowFunc )
425+ RegisterWorkflow (dbosCtx , globalConcurrencyWorkflowFunc )
426+
427+ err := dbosCtx .Launch ()
428+ if err != nil {
429+ t .Fatalf ("failed to launch DBOS instance: %v" , err )
430+ }
419431
420432 // Enqueue two workflows
421- handle1 , err := RunAsWorkflow (dbosContext , globalConcurrencyWorkflowFunc , "workflow1" , WithQueue (globalConcurrencyQueue .name ))
433+ handle1 , err := RunAsWorkflow (dbosCtx , globalConcurrencyWorkflowFunc , "workflow1" , WithQueue (globalConcurrencyQueue .name ))
422434 if err != nil {
423435 t .Fatalf ("failed to enqueue workflow1: %v" , err )
424436 }
425437
426- handle2 , err := RunAsWorkflow (dbosContext , globalConcurrencyWorkflowFunc , "workflow2" , WithQueue (globalConcurrencyQueue .name ))
438+ handle2 , err := RunAsWorkflow (dbosCtx , globalConcurrencyWorkflowFunc , "workflow2" , WithQueue (globalConcurrencyQueue .name ))
427439 if err != nil {
428440 t .Fatalf ("failed to enqueue workflow2: %v" , err )
429441 }
@@ -465,7 +477,7 @@ func TestGlobalConcurrency(t *testing.T) {
465477 if result2 != "workflow2" {
466478 t .Fatalf ("expected result from workflow2 to be 'workflow2', got %v" , result2 )
467479 }
468- if ! queueEntriesAreCleanedUp (dbosContext ) {
480+ if ! queueEntriesAreCleanedUp (dbosCtx ) {
469481 t .Fatal ("expected queue entries to be cleaned up after global concurrency test" )
470482 }
471483}
@@ -498,6 +510,11 @@ func TestWorkerConcurrency(t *testing.T) {
498510 }
499511 RegisterWorkflow (dbosCtx , blockingWfFunc )
500512
513+ err := dbosCtx .Launch ()
514+ if err != nil {
515+ t .Fatalf ("failed to launch DBOS instance: %v" , err )
516+ }
517+
501518 // First enqueue four blocking workflows
502519 handle1 , err := RunAsWorkflow (dbosCtx , blockingWfFunc , 0 , WithQueue (workerConcurrencyQueue .name ), WithWorkflowID ("worker-cc-wf-1" ))
503520 if err != nil {
@@ -653,6 +670,11 @@ func TestWorkerConcurrencyXRecovery(t *testing.T) {
653670 }
654671 RegisterWorkflow (dbosCtx , workerConcurrencyRecoveryBlockingWf2 )
655672
673+ err := dbosCtx .Launch ()
674+ if err != nil {
675+ t .Fatalf ("failed to launch DBOS instance: %v" , err )
676+ }
677+
656678 // Enqueue two workflows on a queue with worker concurrency = 1
657679 handle1 , err := RunAsWorkflow (dbosCtx , workerConcurrencyRecoveryBlockingWf1 , "workflow1" , WithQueue (workerConcurrencyRecoveryQueue .name ), WithWorkflowID ("worker-cc-x-recovery-wf-1" ))
658680 if err != nil {
@@ -760,6 +782,11 @@ func TestQueueRateLimiter(t *testing.T) {
760782 // Create workflow with dbosContext
761783 RegisterWorkflow (dbosCtx , rateLimiterTestWorkflow )
762784
785+ err := dbosCtx .Launch ()
786+ if err != nil {
787+ t .Fatalf ("failed to launch DBOS instance: %v" , err )
788+ }
789+
763790 limit := 5
764791 period := 1.8
765792 numWaves := 3
0 commit comments