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

Coordinator - Extra tests for findConsecutiveProvenBlobs #186

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bradbown
Copy link
Contributor

This PR implements issue(s) #

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

@bradbown bradbown temporarily deployed to docker-build-and-e2e October 15, 2024 11:55 — with GitHub Actions Inactive
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.39%. Comparing base (f9aa7e7) to head (8eee4f2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #186      +/-   ##
============================================
+ Coverage     70.38%   70.39%   +0.01%     
  Complexity     1040     1040              
============================================
  Files           282      282              
  Lines         11314    11314              
  Branches       1082     1082              
============================================
+ Hits           7963     7965       +2     
  Misses         2880     2880              
+ Partials        471      469       -2     
Flag Coverage Δ *Carryforward flag
hardhat 98.70% <ø> (ø) Carriedforward from f9aa7e7
kotlin 67.87% <ø> (+0.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

see 2 files with indirect coverage changes

@bradbown bradbown marked this pull request as ready for review October 17, 2024 08:15
@bradbown bradbown requested a review from a team October 17, 2024 08:15
val blobs = listOf(blob1, blob2)

batches.forEach { insertBatch(it).get() }
blobs.forEach { insertBlob(it).get() }
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is slow. can't they be inserted in parallel ino the Db with SafeFuture.collectAll?

I keep on calling on this :(

@Test
fun findConsecutiveProvenBlobsWhenDbIsEmpty() {
aggregationsPostgresDaoImpl.findConsecutiveProvenBlobs(0).get().also { blobCounters ->
assertThat(blobCounters).hasSameElementsAs(emptyList())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
assertThat(blobCounters).hasSameElementsAs(emptyList())
assertThat(blobCounters).isEmpty()

}

@Test
fun findConsecutiveProvenBlobsUnprovenBlobAndBatchAtDifferentIntervals() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought we were not supposed to have unproven records in the DB. Are we trying to represent any real scenario here?

However, if the DAO/db was designed for such scenarios, then it shall test it

blobs.forEach { insertBlob(it).get() }

aggregationsPostgresDaoImpl.findConsecutiveProvenBlobs(0).get().also { blobCounters ->
assertThat(blobCounters).hasSameElementsAs(emptyList())
Copy link
Collaborator

Choose a reason for hiding this comment

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

I still don't understand well what this test is trying to ensure. Can you please explain?

findConsecutiveProvenBlobs(startBlockNumber) is supposed to return result if there is a blob starting at startBlockNumber right? If so, shall we call it with 1 instead and return blob1 [0..20]?

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.

3 participants