pulumi/pkg/backend/httpstate
Fraser Waters 959fc6c8b4
Run integration tests with race detection (#15895)
<!--- 
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
Combining #15120 and #15124 and including fixes to allow tests to pass.

Enable race detection in the binary we're using for integration tests.
This will allow us to catch more data races before they get into any
release. This does mean the binary we're using for integration tests is
slightly different from the binary we're releasing, however that's
already the case as we're running a binary with coverage enabled for
them. Later we rebuild the binary we're actually releasing.

This requires us to fix the race between snapshot code, display code,
and the step executor. I've done that by adding a lock to the State
struct. This does not feel great, but it's a quick way to fix this and
get race detection running (and unblocks #15871 which was also hitting
the race detector because it started pulling snapshot code into unit
tests as well). There's probably a more principled overhaul that doesn't
require locking at this level.

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [x] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2024-04-11 15:58:42 +00:00
..
client chore: fix function name in comment (#15867) 2024-04-07 12:19:17 +00:00
testdata [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
backend.go Fix nil pointer dereference in pulumi new --ai (#15861) 2024-04-04 15:26:09 +00:00
backend_test.go Support always qualifying stack names (#11081) (#15857) 2024-04-04 10:11:46 +00:00
console.go Add support for a PULUMI_CONSOLE_DOMAIN env var (#4410) 2020-04-17 11:50:00 -07:00
console_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
diffs.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
diffs_post_1.20.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
diffs_pre_1.20.go [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
environments.go [cli] Include config from ESC in `pulumi config` (#14560) 2023-11-21 10:44:45 +00:00
mock.go Pass in a header to indicate where the deployment initiated (#15468) 2024-02-20 04:00:01 +00:00
policypack.go improve display for policy packs (#15186) 2024-01-19 13:40:24 +00:00
snapshot.go Always use the snapshot secret manager (#15768) 2024-03-25 10:30:14 +00:00
snapshot_test.go Always use the snapshot secret manager (#15768) 2024-03-25 10:30:14 +00:00
stack.go Support always qualifying stack names (#11081) (#15857) 2024-04-04 10:11:46 +00:00
state.go Run integration tests with race detection (#15895) 2024-04-11 15:58:42 +00:00
token_source.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
token_source_test.go Use context.Background in tests (#14029) 2023-09-25 12:25:26 +00:00