Skip to content

Fix concurrency test bug and install modules before unit tests#222

Merged
nmburgan merged 2 commits intomainfrom
fix_concurrency_spec_test
Apr 21, 2026
Merged

Fix concurrency test bug and install modules before unit tests#222
nmburgan merged 2 commits intomainfrom
fix_concurrency_spec_test

Conversation

@nmburgan
Copy link
Copy Markdown
Member

@nmburgan nmburgan commented Apr 21, 2026

Short description

Run install_modules before tests:unit

These tests require running 'bundle exec r10k puppetfile install' before running, so this ensures it happens before running tests. It's idempotent and only takes about a second when it's already installed, so we just run it every time.

Fix concurrency test

The default concurrency value is based on what Etc::SC_OPEN_MAX (ulimit) is set to, either divided by 7 or capped at 100. When running unit tests in an environment where this value is less than 700, it results in a number less than the expected 100. Instead, the test is now two tests where the call is stubbed and we verify both the divide by 7 and the 100 cap behavior.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • read and accepted the Developer Certificate of Origin document and added a Signed-off-by annotation to each of my commits
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

@nmburgan nmburgan force-pushed the fix_concurrency_spec_test branch from 1b1d37c to 91ecde3 Compare April 21, 2026 18:40
These tests require running 'bundle exec r10k puppetfile install' before running, so this ensures it happens before running tests. It's idempotent and only takes about a second when it's already installed, so we just run it every time.

Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com>
The default concurrency value is based on what Etc::SC_OPEN_MAX (ulimit) is set to, either divided by 7 or capped at 100. When running unit tests in an environment where this value is less than 700, it results in a number less than the expected 100. Instead, the test is now two tests where the call is stubbed and we verify both the divide by 7 and the 100 cap behavior.

Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com>
@nmburgan nmburgan force-pushed the fix_concurrency_spec_test branch from 91ecde3 to 74888c7 Compare April 21, 2026 18:40
Comment thread rakelib/tests.rake
@nmburgan nmburgan merged commit dee4899 into main Apr 21, 2026
98 of 100 checks passed
@nmburgan nmburgan deleted the fix_concurrency_spec_test branch April 21, 2026 23:23
@nmburgan nmburgan added the bug Something isn't working label Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants