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

fix: prevent variable shadow in TestModuleDaggerDevelop #6926

Merged
merged 1 commit into from Mar 25, 2024

Conversation

jedevc
Copy link
Member

@jedevc jedevc commented Mar 25, 2024

Introduced in #6860, causing some additional test flake.

This manifested as additional flakiness in the test, causing out to be written to in a racey way:

WARNING: DATA RACE
Write at 0x00c00189a6c0 by goroutine 20341:
  github.com/dagger/dagger/core/integration.TestModuleDaggerDevelop.func1.1()
      /app/core/integration/module_config_test.go:542 +0x9bd
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      /usr/local/go/src/testing/testing.go:1648 +0x44

Previous write at 0x00c00189a6c0 by goroutine 20342:
  github.com/dagger/dagger/core/integration.TestModuleDaggerDevelop.func1.1()
      /app/core/integration/module_config_test.go:542 +0x9bd
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      /usr/local/go/src/testing/testing.go:1648 +0x44

This manifested as additional flakiness in the test, causing `out` to be
written to in a racey way:

	WARNING: DATA RACE
	Write at 0x00c00189a6c0 by goroutine 20341:
	  github.com/dagger/dagger/core/integration.TestModuleDaggerDevelop.func1.1()
	      /app/core/integration/module_config_test.go:542 +0x9bd
	  testing.tRunner()
	      /usr/local/go/src/testing/testing.go:1595 +0x261
	  testing.(*T).Run.func1()
	      /usr/local/go/src/testing/testing.go:1648 +0x44

	Previous write at 0x00c00189a6c0 by goroutine 20342:
	  github.com/dagger/dagger/core/integration.TestModuleDaggerDevelop.func1.1()
	      /app/core/integration/module_config_test.go:542 +0x9bd
	  testing.tRunner()
	      /usr/local/go/src/testing/testing.go:1595 +0x261
	  testing.(*T).Run.func1()
	      /usr/local/go/src/testing/testing.go:1648 +0x44

Signed-off-by: Justin Chadwell <me@jedevc.com>
@jedevc jedevc requested review from vito and sipsma March 25, 2024 15:18
@@ -539,7 +539,7 @@ func TestModuleDaggerDevelop(t *testing.T) {
})

// should be able to invoke it directly now
out, err = ctr.With(daggerCall("fn")).Stdout(ctx)
out, err := ctr.With(daggerCall("fn")).Stdout(ctx)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love a good one line fix 🎉

Copy link
Contributor

@vito vito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw this too and just tossed a commit onto the pile in #6835 - thanks for opening a separate PR :)

@jedevc jedevc merged commit eeeb16f into dagger:main Mar 25, 2024
43 checks passed
@jedevc jedevc deleted the fix-develop-test-race branch March 25, 2024 16:14
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 this pull request may close these issues.

None yet

2 participants