Skip to content
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

nf-test hang on very simple workflow tests #57

Closed
byb121 opened this issue Nov 8, 2022 · 2 comments · Fixed by #112
Closed

nf-test hang on very simple workflow tests #57

byb121 opened this issue Nov 8, 2022 · 2 comments · Fixed by #112
Milestone

Comments

@byb121
Copy link
Contributor

byb121 commented Nov 8, 2022

nf-test can hang when running a test on a very simple workflow. Here's the code to replicate the issue:

$ cat example/meaningless_workflow.nf
workflow PipeWf {
    take:
        inputCh

    main:
        inputCh
            | set { outputCh }

    emit:
        outputCh
}

$ cat example/meaningless_workflow.nf.test 

nextflow_workflow {

    name "Test workflow"
    script "example/meaningless_workflow.nf"
    workflow "PipeWf"

    test("PipeWf will hang") {

        when {
            workflow {
                """
                input[0] = Channel.from([
                  [
                    ["patientID": "patientA"],
                    'test_file_1.txt'
                  ]
                ])
                """
            }
        }

        then {
              assert workflow.success
            }

    }

}

$ nf-test test example/meaningless_workflow.nf.test
# This will hang
@lukfor
Copy link
Collaborator

lukfor commented Nov 11, 2022

Thanks for reporting this.

I see the following in nextflow.log:

Nov-11 15:12:31.429 [main] DEBUG nextflow.Session - Work-dir: /Users/lukfor/Development/git/nf-test/.nf-test/tests/5c41ebd9d6e23bf26ac210b5809436b5/work [Mac OS X]
Nov-11 15:12:31.453 [main] DEBUG nextflow.executor.ExecutorFactory - Extension executors providers=[]
Nov-11 15:12:31.459 [main] DEBUG nextflow.Session - Observer factory: DefaultObserverFactory
Nov-11 15:12:31.474 [main] DEBUG nextflow.cache.CacheFactory - Using Nextflow cache factory: nextflow.cache.DefaultCacheFactory
Nov-11 15:12:31.481 [main] DEBUG nextflow.util.CustomThreadPool - Creating default thread pool > poolSize: 9; maxThreads: 1000
Nov-11 15:12:31.521 [main] DEBUG nextflow.Session - Session start invoked
Nov-11 15:12:31.525 [main] DEBUG nextflow.trace.TraceFileObserver - Flow starting -- trace file: /Users/lukfor/Development/git/nf-test/.nf-test/tests/5c41ebd9d6e23bf26ac210b5809436b5/meta/trace.csv
Nov-11 15:12:31.528 [main] DEBUG nextflow.Session - Using default localLib path: /Users/lukfor/Development/git/nf-test/.nf-test/tests/5c41ebd9d6e23bf26ac210b5809436b5/meta/lib
Nov-11 15:12:31.530 [main] DEBUG nextflow.Session - Adding to the classpath library: /Users/lukfor/Development/git/nf-test/.nf-test/tests/5c41ebd9d6e23bf26ac210b5809436b5/meta/lib
Nov-11 15:12:31.907 [main] DEBUG nextflow.script.ScriptRunner - > Launching execution
Nov-11 15:12:32.023 [main] DEBUG nextflow.Session - Workflow process names [dsl2]: 
Nov-11 15:12:32.025 [main] DEBUG nextflow.Session - Ignite dataflow network (2)
Nov-11 15:12:32.025 [main] DEBUG nextflow.script.ScriptRunner - > Await termination 
Nov-11 15:12:32.025 [main] DEBUG nextflow.Session - Session await
Nov-11 15:12:32.025 [main] DEBUG nextflow.Session - Session await > all process finished
Nov-11 15:12:32.025 [main] DEBUG nextflow.Session - Session await > all barriers passed
Nov-11 15:12:32.032 [main] DEBUG nextflow.Session - This looks weird, attempt number 2 to join pending operators

It seems that Nextflow hang when nf-test tries to serialize the output channels.

@julibeg
Copy link

julibeg commented Nov 17, 2022

Seconded; new File("${params.nf_test_output}/function.json").text = jsonOutput.toJson(result) in the mock script blocks when only parsing a small CSV.

This was referenced Aug 28, 2023
@lukfor lukfor added this to the 0.8.0 milestone Aug 30, 2023
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 a pull request may close this issue.

3 participants