Skip to content

Background tasks in Cram tests are not terminated #11820

@Willenbrink

Description

@Willenbrink

Expected Behavior

When a cram test terminates, all running background tasks (e.g. started via &) should be terminated too.

A reasonable alternative would be to wait for all tasks to terminate. As some background tasks never terminate and that behavior can be replicated by calling wait I think the first option is preferable.

Actual Behavior

Background tasks continue to run and never terminate.

Reproduction

  1. Create a cram test that start some server in the background, e.g.
  $ ncat -l 2000 -k -c 'xargs -n1 echo' &
  1. dune runtest
  2. The server is still available and responds to e.g. ncat localhost 2000

Specifications

  • Version of dune (output of dune --version): 3.18.2
  • Version of ocaml (output of ocamlc --version): 5.3.0
  • Operating system (distribution and version): Fedora

Workaround

Adding pkill -P $$ as the last line to a cram test kills all child tasks.

Metadata

Metadata

Assignees

Labels

bugcramRelated to the cram test execution in Dune

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions