aws / karpenter-provider-aws

Karpenter is a Kubernetes Node Autoscaler built for flexibility, performance, and simplicity.
https://karpenter.sh
Apache License 2.0
6.58k stars 915 forks source link

Ensure that some End to End tests run with a -race build #1387

Open tzneal opened 2 years ago

tzneal commented 2 years ago

Tell us about your request

At least some portion (possibly all?) e2e tests should run with a -race build.

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?

Since concurrent reconciles can occur we want to ensure that our reconcilers are race free. Unit testing can be helpful, but a full e2e test with a -race build will be more effective at identifying issues.

Community Note

spring1843 commented 2 years ago

Doesn't this mean they are all running with -race? https://github.com/aws/karpenter/blob/main/Makefile#L35

tzneal commented 2 years ago

Doesn't this mean they are all running with -race? https://github.com/aws/karpenter/blob/main/Makefile#L35

The units tests are running with the race detector, but I don't know if there are any end to end tests yet. This issue was to ensure that those tests, when they exist, are run with -race as well.

engedaam commented 1 year ago

-race injects artificial timing delays to goroutines, which might not be ideal for our e2etests

jonathan-innis commented 1 year ago

-race injects artificial timing delays to goroutines, which might not be ideal for our e2etests

This isn't what -race does. -race detects data races in our E2E testing to ensure that we aren't writing race-y tests that have potential to cause data races and data corruption. It seems like good hygiene to have this in our go test call if nothing more than catching data races in our test code that we have accidentally written in.