# Turborepo runs scripts unnecessarily for packages that do not define the task
## The problem
Running `turbo run test` executes dependency tasks for every package in the monorepo, even packages that do not define a `test` script at all. For example, if only the bar package has a `test` script depending on foo, the `build` task of an unrelated baz package still runs. The expected behavior is that turbo only builds the task graph from packages that actually define the task. This affects large monorepos where hundreds of useless task invocations slow everything down.
## The verified fix
This is by design in older turbo versions: task entrypoints were selected loosely, so dependency tasks ran for every package regardless of whether it defined the script. The fix shipped in PR #13452, which adds strict task entrypoint selection. Opt into it on turbo 2.x with a future flag in turbo.json: {"futureFlags": {"strictTaskEntrypointSelection": true}}. It becomes the default behavior in turbo 3.0. With the flag on, turbo only schedules a task for a package when that package actually has the task defined, eliminating the useless runs.
Source: https://github.com/vercel/turborepo/issues/937