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

chore: fixing a flaky rsources test #2680

Merged
merged 1 commit into from
Nov 17, 2022
Merged

chore: fixing a flaky rsources test #2680

merged 1 commit into from
Nov 17, 2022

Conversation

atzoum
Copy link
Contributor

@atzoum atzoum commented Nov 9, 2022

Description

Resolved 3 issues with the flaky tests:

  1. Removed transactions and if exists clauses from create table, since it could lead to tables not being created in some scenarios, e.g. 2 concurrent transactions, 1st creates the table, 2nd skips, then 1st does a Tx rollback so table is not created.
  2. Improper use of nested Ordered Ginkgo containers and BeforeAll which caused containers to be reused beyond the desired boundaries.
  3. Assertion of expected response when retrieving failed records could fail due to ordering inconsistencies.

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@codecov
Copy link

codecov bot commented Nov 9, 2022

Codecov Report

Base: 45.51% // Head: 45.47% // Decreases project coverage by -0.04% ⚠️

Coverage data is based on head (9bd67a6) compared to base (d01f98b).
Patch coverage: 41.53% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2680      +/-   ##
==========================================
- Coverage   45.51%   45.47%   -0.05%     
==========================================
  Files         289      290       +1     
  Lines       48007    48028      +21     
==========================================
- Hits        21852    21841      -11     
- Misses      24775    24804      +29     
- Partials     1380     1383       +3     
Impacted Files Coverage Δ
testhelper/log/log.go 7.69% <7.69%> (ø)
services/rsources/handler.go 73.16% <61.11%> (+1.49%) ⬆️
processor/stash/stash.go 44.56% <100.00%> (ø)
services/rsources/rsources.go 66.66% <100.00%> (+0.56%) ⬆️
router/manager/manager.go 96.70% <0.00%> (-3.30%) ⬇️
config/backend-config/namespace_config.go 70.83% <0.00%> (-3.13%) ⬇️
processor/processor.go 85.99% <0.00%> (-0.42%) ⬇️
router/router.go 73.80% <0.00%> (-0.19%) ⬇️
services/db/recovery.go 53.01% <0.00%> (+2.40%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@atzoum atzoum force-pushed the test.flakyTrace branch 3 times, most recently from 81bf86b to 136fd16 Compare November 15, 2022 08:41
@atzoum atzoum changed the title [WIP] chore: fighting a flaky test [WIP] chore: fixing a flaky rsources test Nov 15, 2022
@atzoum atzoum changed the title [WIP] chore: fixing a flaky rsources test chore: fixing a flaky rsources test Nov 15, 2022
@atzoum atzoum force-pushed the test.flakyTrace branch 2 times, most recently from 24d5a1b to e6c05ab Compare November 15, 2022 09:35
@atzoum atzoum force-pushed the test.flakyTrace branch 2 times, most recently from ce174ad to 5e56f37 Compare November 15, 2022 09:38
@atzoum atzoum marked this pull request as draft November 15, 2022 10:15
@atzoum atzoum force-pushed the test.flakyTrace branch 2 times, most recently from c16187f to 92cad02 Compare November 15, 2022 12:01
@atzoum atzoum marked this pull request as ready for review November 15, 2022 12:29
@atzoum atzoum force-pushed the test.flakyTrace branch 3 times, most recently from 0068653 to 4e3a11d Compare November 15, 2022 18:29
Copy link
Member

@chandumlg chandumlg left a comment

Choose a reason for hiding this comment

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

Isn't just transaction removal sufficient. Why remove if exists?

@cisse21 cisse21 merged commit ad2626f into master Nov 17, 2022
@cisse21 cisse21 deleted the test.flakyTrace branch November 17, 2022 07:41
@atzoum
Copy link
Contributor Author

atzoum commented Nov 17, 2022

Isn't just transaction removal sufficient. Why remove if exists?

IF EXISTS skips table creation if another concurrent transaction already created the table even though it is not committed yet. By removing the IF EXISTS, we are blocking until the second transaction ends and either create the table if the other transaction fails, or skip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants