@@ -735,6 +735,28 @@ func TestReadTerragruntConfigDependencyInStack(t *testing.T) {
735735 "read_terragrunt_config should be able to parse dependency blocks during stack runs" )
736736}
737737
738+ // TestReadTerragruntConfigDependencyInStackWithRacing exercises the same scenario
739+ // as TestReadTerragruntConfigDependencyInStack under the race detector.
740+ // The `run --all` command internally processes units concurrently, which is
741+ // sufficient to trigger races in the download/cache path.
742+ // The CI "Race" job runs tests matching .*WithRacing with -race.
743+ func TestReadTerragruntConfigDependencyInStackWithRacing (t * testing.T ) {
744+ t .Parallel ()
745+
746+ helpers .CleanupTerraformFolder (t , testFixtureReadConfigDependencyStack )
747+ tmpEnvPath := helpers .CopyEnvironment (t , testFixtureReadConfigDependencyStack )
748+ rootPath := filepath .Join (tmpEnvPath , testFixtureReadConfigDependencyStack )
749+
750+ _ , stderr , err := helpers .RunTerragruntCommandWithOutput (
751+ t ,
752+ "terragrunt run --all plan --non-interactive --working-dir " + rootPath ,
753+ )
754+ require .NoError (t , err )
755+
756+ assert .NotContains (t , stderr , "\" dependency\" is not defined" ,
757+ "read_terragrunt_config should be able to parse dependency blocks during stack runs" )
758+ }
759+
738760// TestChainedDepsExposedIncludeNoErrorLog verifies that chaining dependencies with exposed
739761// includes does not produce spurious ERROR-level log messages.
740762// This is a regression test for https://github.com/gruntwork-io/terragrunt/issues/4153
0 commit comments