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 flaky parallel dirOps e2e tests #2852

Merged
merged 8 commits into from
Jan 3, 2025

Conversation

Tulsishah
Copy link
Collaborator

@Tulsishah Tulsishah commented Jan 2, 2025

Description

Potential Problems:

  1. Data Race: The update to statInfo and lookUpErr in the goroutine may not be visible to the main thread immediately.
    This can lead to a situation where lookUpErr == nil, but statInfo still appears nil in the main thread and cause panic.
  2. Improper Synchronization: Even though we're using sync.WaitGroup to wait for goroutines to finish, there is no explicit guarantee that statInfo and lookUpErr are synchronized across goroutines and the main thread.

Applied Fixes:

  1. Use pointers to pass results (statInfo, lookUpErr, etc.) directly to avoid shared variable conflicts.
  2. Avoid Shared Variables: Each goroutine updates its respective variables, ensuring no concurrent writes to shared memory.
  3. Thread-Safe Updates: By passing pointers, the main thread accesses fully updated variables after wg.Wait().

Link to the issue in case of a bug fix.

  1. b/387209276
  2. b/383948909
  3. b/386583075

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - Automated

@Tulsishah Tulsishah added the execute-integration-tests Run only integration tests label Jan 2, 2025
Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.10%. Comparing base (84f8195) to head (3b9d79f).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2852      +/-   ##
==========================================
+ Coverage   76.08%   76.10%   +0.01%     
==========================================
  Files         118      118              
  Lines       16557    16557              
==========================================
+ Hits        12598    12601       +3     
+ Misses       3427     3425       -2     
+ Partials      532      531       -1     
Flag Coverage Δ
unittests 76.10% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Tulsishah Tulsishah changed the title Fix flaky parallel dir ops test Fix flaky parallel dir ops tests Jan 2, 2025
@Tulsishah Tulsishah marked this pull request as ready for review January 2, 2025 10:09
@Tulsishah Tulsishah requested a review from a team as a code owner January 2, 2025 10:09
@kislaykishore kislaykishore requested review from a team, BrennaEpp, gargnitingoogle, ashmeenkaur and tritone and removed request for ashmeenkaur, a team, BrennaEpp, gargnitingoogle and tritone January 2, 2025 10:10
@kislaykishore kislaykishore requested review from gargnitingoogle and a team and removed request for ashmeenkaur and tritone January 2, 2025 10:11
@Tulsishah Tulsishah changed the title Fix flaky parallel dir ops tests Fix flaky parallel dir ops e2e tests Jan 2, 2025
@Tulsishah Tulsishah changed the title Fix flaky parallel dir ops e2e tests Fix flaky parallel dirops e2e tests Jan 2, 2025
@Tulsishah Tulsishah requested a review from ashmeenkaur January 2, 2025 10:26
@Tulsishah Tulsishah changed the title Fix flaky parallel dirops e2e tests Fix flaky parallel dirOps e2e tests Jan 2, 2025
@Tulsishah Tulsishah merged commit 19f1a0f into master Jan 3, 2025
24 of 27 checks passed
ashmeenkaur pushed a commit that referenced this pull request Jan 6, 2025
* fix flaky parellal dir ops test

* remove unnecessary changes

* remove unnecessary changes

* fix rest of the tests

* fix rest of the tests

* small fix

* fix rest of the tests

* create common function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execute-integration-tests Run only integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants