Skip to content

Remove Mock Mempool#3687

Merged
StephenButtolph merged 8 commits intomasterfrom
remove-mock-mempool
Feb 11, 2025
Merged

Remove Mock Mempool#3687
StephenButtolph merged 8 commits intomasterfrom
remove-mock-mempool

Conversation

@joshua-kim
Copy link
Copy Markdown
Contributor

@joshua-kim joshua-kim commented Jan 30, 2025

Why this should be merged

Removes the usage of the mempool mock which makes tests brittle and difficult to reason about

How this works

Removes usage of mock and replaces it with the usage of the concrete mempool

How this was tested

UTs

Need to be documented in RELEASES.md?

No

Signed-off-by: Joshua Kim <[email protected]>
@joshua-kim joshua-kim marked this pull request as draft January 30, 2025 21:24
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
}

// Add should error if adding to the mempool errors
func TestGossipMempoolAddError(t *testing.T) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This test seems to just test the invariants of the mempool (too big/max size/etc) so I removed it since similar coverage exists elsewhere in this package

Signed-off-by: Joshua Kim <[email protected]>

tests := []test{
{
name: "can't add transaction to mempool",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Similarly this test I also don't know if we want to keep... if we wanted to keep what this was intended to test we would probably want to add tests for the same mempool invariants described earlier

@joshua-kim joshua-kim marked this pull request as ready for review January 30, 2025 22:01
@joshua-kim joshua-kim self-assigned this Jan 30, 2025
@joshua-kim joshua-kim added the cleanup Code quality improvement label Jan 30, 2025
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Signed-off-by: Joshua Kim <[email protected]>
Comment thread vms/avm/block/builder/builder_test.go Outdated
Comment thread vms/avm/block/builder/builder_test.go
Comment thread vms/avm/block/builder/builder_test.go
Comment thread vms/avm/block/builder/builder_test.go
Comment thread vms/avm/block/executor/block_test.go
Comment thread vms/avm/block/executor/block_test.go
Comment thread vms/avm/block/executor/block_test.go
Signed-off-by: Joshua Kim <[email protected]>
Copy link
Copy Markdown
Contributor

@rrazvan1 rrazvan1 left a comment

Choose a reason for hiding this comment

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

LGTM

(maybe we can improve these tests with my suggestions in another PR)

Copy link
Copy Markdown
Contributor

@StephenButtolph StephenButtolph left a comment

Choose a reason for hiding this comment

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

🧹

@StephenButtolph StephenButtolph added this pull request to the merge queue Feb 11, 2025
Merged via the queue into master with commit 6a4413d Feb 11, 2025
@StephenButtolph StephenButtolph deleted the remove-mock-mempool branch February 11, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code quality improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants