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

🐛 Add race option to detect raced codes #10899

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove sync variable
Signed-off-by: sivchari <[email protected]>
  • Loading branch information
sivchari committed Aug 27, 2024
commit 567e04f8bf70a7a24a2cc8cd33b80d5b66d663c0
4 changes: 0 additions & 4 deletions test/infrastructure/inmemory/pkg/runtime/cache/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ func (c *cache) startSyncer(ctx context.Context) error {
c.syncQueue.ShutDown()
}()

syncLoopStarted := make(chan struct{})
go func() {
log.Info("Starting sync loop")
syncLoopStarted <- struct{}{}
for {
select {
case <-time.After(c.syncPeriod / 4):
Expand Down Expand Up @@ -81,8 +79,6 @@ func (c *cache) startSyncer(ctx context.Context) error {
wg.Wait()
}()

<-syncLoopStarted

if err := wait.PollUntilContextTimeout(ctx, 50*time.Millisecond, 5*time.Second, false, func(context.Context) (done bool, err error) {
if atomic.LoadInt64(&workers) < int64(c.syncConcurrency) {
return false, nil
Expand Down
Loading