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(composer): improve blackbox test efficiency #1925

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ethanoroshiba
Copy link
Contributor

@ethanoroshiba ethanoroshiba commented Jan 22, 2025

Summary

Improves composer testing efficiency by manually ticking the executor's block timer to preempt bundle submission instead of waiting.

Background

Previously, loop_until_composer_is_ready() had a minimum of a 1 second delay, which many of the blackbox tests became reliant on to trigger bundle submission. This change removes the delay in looping until composer is ready, opting to manually tick the block timer via tokio::time.

Changes

  • Removed delay in loop_until_composer_is_ready() in favor of tokio::task::yield_now().
  • Added TestComposer method tick_block_timer, which sleeps for 10ms to allow for tx submission from the rollup before ticking the block timer (lowest latency I found to be consistently successful), then advances time by block_time_ms to trigger bundle submission.
  • Made all testing timeouts 100ms and added calls to tick_block_timer

Testing

All tests passing consistently, blackbox tests now run consistently within ~2s locally.

Changelogs

No updates required.

Related Issues

closes #1920

@ethanoroshiba ethanoroshiba added composer pertaining to composer testing labels Jan 22, 2025
@ethanoroshiba ethanoroshiba marked this pull request as ready for review January 22, 2025 17:56
@ethanoroshiba ethanoroshiba requested a review from a team as a code owner January 22, 2025 17:56
@SuperFluffy
Copy link
Member

SuperFluffy commented Jan 24, 2025

I like the idea of moving away form hard looping + fixed sleeping, but I am ambivalent on the explicit use of tokio time::pause, time::advance, and time::resume, because it comes with its own set of problems (like skipping over timers, triggering a timer multiple times).

It also only works with the current_thread runtime flavor, which we have already moved away from in conductor, sequencer-relayer because it doesn't play well with checking shutdown logic (we use a Drop impl for the test environments which blocks the thread from continuing on).

We should think about a alternative approach to improve test quality composer away from tokio's time utils.

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

Successfully merging this pull request may close these issues.

Improve composer test efficiency
2 participants