Skip to content

chore: reduce unit and integration test sleep durations#2596

Open
Deepak8858 wants to merge 1 commit intotektoncd:mainfrom
Deepak8858:fix/issue-2594-test-sleep-duration
Open

chore: reduce unit and integration test sleep durations#2596
Deepak8858 wants to merge 1 commit intotektoncd:mainfrom
Deepak8858:fix/issue-2594-test-sleep-duration

Conversation

@Deepak8858
Copy link

Fixes #2594

Reduced test suite duration by replacing artificially long sleeps with shorter delays while maintaining reliability.

…ncd#2594)

Reduced test suite duration by replacing artificially long sleeps with
shorter delays while maintaining reliability.
@linux-foundation-easycla
Copy link

CLA Missing ID CLA Not Signed

@chmouel
Copy link
Member

chmouel commented Mar 19, 2026

/ok-to-test

Copy link
Member

@chmouel chmouel left a comment

Choose a reason for hiding this comment

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

The comparison was done by running the full unit test suite on both the main branch and this PR branch using the same command:

make test-clean; go test ./... -v | tee /tmp/reduce-unit.log
  • make test-clean ensures a clean state (no leftover artifacts or cache interference).
  • go test ./... -v runs all tests across all packages with verbose output.
  • Output is captured with tee for later analysis and comparison.

The resulting logs from both runs were then compared using an LLM to identify differences in execution time and highlight performance changes across packages and test cases.

There is a small improvement in test execution time, mainly in pkg/adapter (~5% faster), driven by a slightly faster Test_listener_detectIncoming path (notably the not_git_provider_type_provided case).

However, the gain remains marginal (on the order of tens of milliseconds) and does not change the overall performance profile. The test suite is still dominated by the same slow path, and no broader optimization is visible.

This likely needs further work to be considered a meaningful improvement.

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.

chore: unit tests use real time.Sleep causing slow test suite

2 participants