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: improvements for test repeatability #642

Closed
ata-nas opened this issue Feb 13, 2025 · 1 comment · Fixed by #766
Closed

chore: improvements for test repeatability #642

ata-nas opened this issue Feb 13, 2025 · 1 comment · Fixed by #766
Assignees
Labels
Tests issue related to enhancing the tests
Milestone

Comments

@ata-nas
Copy link
Contributor

ata-nas commented Feb 13, 2025

Persona

As a Block Node Developer

Request

I want to have repeatable tests whenever possible

Goal

So that the tests are not flaky and will not hinder CI/CD

Technical Notes

Since the development of new async block writers, it became evident that there are some tests failing because some logic runs async. Simply by the time we reach the asserts, the logic that would produce the desired results for the asserts is not yet finished. We should make these (and similar) tests repeatable in the sense that we should ensure that the async tasks have enough time to complete before we do the asserts.

  • an idea is to inject an executor that will allow us to wait for the tasks to complete, blocking the test thread

Tests that were disabled and need migration:

  • com.hedera.block.server.pbj.PbjBlockStreamServiceIntegrationTest#testFullProducerConsumerHappyPath
  • com.hedera.block.server.pbj.PbjBlockStreamServiceIntegrationTest#testPublishBlockStreamRegistrationAndExecution
  • com.hedera.block.server.mediator.LiveStreamMediatorImplTest#testMediatorPersistenceWithoutSubscribers

Considerations:

  • based on this thread consider to use jimfs and/ or mocks
@ata-nas ata-nas added the Tests issue related to enhancing the tests label Feb 13, 2025
@ata-nas ata-nas added this to the 0.5.0 milestone Feb 13, 2025
@jsync-swirlds jsync-swirlds changed the title chore: improvements for test determinism chore: improvements for test repeatability Feb 14, 2025
@AlfredoG87 AlfredoG87 modified the milestones: 0.5.0, 0.6.0 Feb 21, 2025
AlexKehayov added a commit to AlexKehayov/hedera-block-node that referenced this issue Feb 28, 2025
AlexKehayov added a commit to AlexKehayov/hedera-block-node that referenced this issue Feb 28, 2025
@AlexKehayov
Copy link
Contributor

Can you assign me this issue, please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tests issue related to enhancing the tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants