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: Adds sleep in tests to avoid out of capacity errors #2674

Merged
merged 7 commits into from
Oct 10, 2024

Conversation

lantoli
Copy link
Member

@lantoli lantoli commented Oct 10, 2024

Description

Adds sleep in tests to avoid out of capacity errors.

This PR is to test the hypothesis that out of capacity errors in tests are caused because clusters are created simultaneously in the same project, see HELP-65223 for more info.

The previous PR didn't work because the way tests are executed in Go. They run in serial until t.Parallel() is called. In that PR sleep was before that call so only test preparation was serialized but then all parallel tests would start at the same time.

In this PR, the sleep is in PreCheck functions, that are called when the tests are already running in parallel.

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@@ -48,8 +48,6 @@ func ProjectIDExecution(tb testing.TB) string {
sharedInfo.projectName = RandomProjectName()
tb.Logf("Creating execution project: %s\n", sharedInfo.projectName)
sharedInfo.projectID = createProject(tb, sharedInfo.projectName)
} else {
Copy link
Member Author

Choose a reason for hiding this comment

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

revert previous PR

@lantoli lantoli marked this pull request as ready for review October 10, 2024 10:29
@lantoli lantoli requested a review from a team as a code owner October 10, 2024 10:29
@lantoli lantoli changed the title chore: Sleep config chore: Adds sleep in tests to avoid out of capacity errors Oct 10, 2024
@@ -8,7 +8,7 @@ endif

ACCTEST_REGEX_RUN?=^TestAcc
ACCTEST_TIMEOUT?=300m
PARALLEL_GO_TEST?=20
PARALLEL_GO_TEST?=50
Copy link
Member Author

Choose a reason for hiding this comment

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

don't limit parallel tests

@lantoli lantoli merged commit b387355 into master Oct 10, 2024
37 checks passed
@lantoli lantoli deleted the sleep_config branch October 10, 2024 13:46
lantoli added a commit that referenced this pull request Oct 16, 2024
* master: (44 commits)
  Remove RemoveResource from Create and Update (#2694)
  sleep first time only (#2696)
  fix: Ensures event_trigger `disabled` is included in the PUT payload (#2690)
  chore: Bump srvaroa/labeler from 1.11.0 to 1.11.1 (#2695)
  build(deps): bump go.mongodb.org/atlas-sdk (#2686)
  fix: Avoids setting organization id to empty when the USER_IS_NOT_FOUND (#2684)
  doc: Corrects default value of `auto_scaling_disk_gb_enabled` (#2683)
  chore: Reminder to log test failures (#2688)
  chore: Updates CHANGELOG.md for #2670
  feat: Supports `config_server_type` and `config_server_management_mode` in advanced_cluster (#2670)
  chore: Creates `advancedclustertpf` package for new implementation (#2679)
  chore: Removes deprecation warnings for `labels` in cluster/adv_cluster (#2678)
  doc: Adjusts `redact_client_log_data` doc (#2676)
  chore: Adds sleep in tests to avoid out of capacity errors (#2674)
  refactor: Adjust type of set structure in team update logic (#2675)
  chore: Updates CHANGELOG.md header for v1.21.1 release
  chore: Updates examples link in index.md for v1.21.1 release
  build(deps): bump go.mongodb.org/atlas-sdk (#2672)
  doc: Fixes Public -> Private Preview and adds contact link. (#2671)
  chore: Updates CHANGELOG.md for #2669
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants