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

Update async processor tests #2577

Merged
merged 12 commits into from
Jan 22, 2025
Merged

Conversation

rafal-ch
Copy link
Contributor

Closes #2449
Or at least, tries to :)

Description

Summary of changes, each in separate commit for clarity. The change that attempts to fix the actual flakiness reported in the issue in pt. 2 below:

  1. Modify one_spawn_single_tasks_works() to not use sleep
  2. Updates assertion in one_spawn_single_tasks_works__thread_id_is_different_than_main()
    • The original test expected the exact number of worker threads to be spawned (assert_eq!(unique_thread_ids.len(), number_of_threads);), however, the AsyncProcessor can potentially reuse threads if the tasks finish quick enough.
    • One way to reduce the flakiness would be to bump the sleep, but I think the more clear way is to ensure that some (but not too many) worker threads have been spawned
      • Especially because the aim of the test is not to ensure the number of worker threads, but to check that main thread id was not used
  3. Reduces the arbitrary number of tasks in executes_10_tasks_for_10_seconds_with_one_thread, just to make the test execute faster
  4. Add some clarifying comments
  5. Slightly update and rename the executes_10_tasks_for_2_seconds_with_10_thread() and executes_10_tasks_for_2_seconds_with_1_thread() - to use proper values and better reflect the idea behind the test

Before requesting review

  • I have reviewed the code myself

@rafal-ch rafal-ch changed the title Rafal/2449 update async processor tests Update async processor tests Jan 15, 2025
@rafal-ch rafal-ch added the no changelog Skip the CI check of the changelog modification label Jan 15, 2025
@rafal-ch rafal-ch marked this pull request as ready for review January 16, 2025 11:14
@rafal-ch rafal-ch requested a review from AurelienFT January 16, 2025 11:14
Copy link
Contributor

@AurelienFT AurelienFT left a comment

Choose a reason for hiding this comment

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

Thanks a lot for taking the time to (try to) stabilize this :)

crates/services/src/async_processor.rs Show resolved Hide resolved
@rafal-ch rafal-ch requested a review from AurelienFT January 16, 2025 18:45
@rafal-ch rafal-ch enabled auto-merge (squash) January 22, 2025 07:15
@rafal-ch rafal-ch merged commit 2031bea into master Jan 22, 2025
30 checks passed
@rafal-ch rafal-ch deleted the rafal/2449_update_async_processor_tests branch January 22, 2025 07:33
@MitchTurner MitchTurner mentioned this pull request Jan 22, 2025
MitchTurner added a commit that referenced this pull request Jan 22, 2025
## Version v0.41.1

* fault_proving(compression): include block_id in da compressed block
headers by @rymnc in #2551
* chore: Add myself and Andrea as codeowner for graphql API + related
crates by @netrome in #2570
* fix(integration_tests): remove flake from
produce_block__l1_committed_block_affects_gas_price by @rymnc in
#2566
* bugfix: Improve the `BlockCommitterHttpApi` client to use `url` apis
better by @MitchTurner in
#2599
* Fix version compatibility error by @AurelienFT in
#2608
* Improve error messages for responses from committer by @MitchTurner in
#2609
* Update async processor tests by @rafal-ch in
#2577
* The amount of returned dust coins is limited by factor relative to the
amount of selected big coins by @rafal-ch in
#2610
* fix(da_compression): invalid decompression of utxo id and CoinConfig
fix by @rymnc in #2593
* Use latest gas price to estimate next price for tx pool checks by
@MitchTurner in #2612
* Set Latest Recorded Height on startup by @MitchTurner in
#2603
* Use latest gas price to estimate next block gas price during dry runs
by @MitchTurner in #2615
* Check that fuel-core lib builds correctly without default features by
@rafal-ch in #2594
* Expose indexation status in `NodeInfo` endpoint by @rafal-ch in
#2595


**Full Changelog**:
v0.41.0...v0.41.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Skip the CI check of the changelog modification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix flaky one_spawn_single_tasks_works__thread_id_is_different_than_main test
3 participants