-
-
Notifications
You must be signed in to change notification settings - Fork 998
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fixing concurrent access to read files map (#3615)
* fix: Fixing concurrent access to read files map * fix: Strangely it's still not working. Getting help. * fix: Removing debug code * fix: Making the insert atomic * chore: Adding units reading race condition test * feat: Adding test to hopefully trigger race condition in concurrent units reading test * fix: These are called units * fix: I guess I have to use `CopyFolderContents` * fix: Removing unused import * fix: Fixing ephemeral unit generation * fix: Use unit names instead of directories * feat: Increasing load to increase likliehood of race condition * Revert "Merge branch 'chore/adding-units-reading-race-condition-test' into yousif/tg-655-fatal-error-concurrent-map-writes-gitlab-pipeline-when" This reverts commit 0518d96, reversing changes made to f70dc72. * fix: Adding test specifically for the race condition * feat: Adding extra test for race conditions * fix: Adjusting jobs so that race tests run as their own jobs * fix: Forgot to also add them here * fix: I immediately knew I'd regret that
- Loading branch information
Showing
3 changed files
with
90 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Tests specific to race conditions are verified here | ||
|
||
package test_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/gruntwork-io/terragrunt/options" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestStrictModeWithRacing(t *testing.T) { | ||
t.Parallel() | ||
|
||
opts, err := options.NewTerragruntOptionsForTest("race_test") | ||
require.NoError(t, err) | ||
|
||
go opts.AppendReadFile("file.json", "unit") | ||
go opts.AppendReadFile("file.json", "other-unit") | ||
} |