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

refactor(ledger): remove manual leak detection in ledger tests #305

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

dadepo
Copy link
Contributor

@dadepo dadepo commented Oct 7, 2024

This PR removes the hardcoded gpa, with manual leak detection from the TestState used in tests.

I believe the reason for this was to have more stack trace frames than what the std.testing.allocator offers, but this proved problematic when using the TestingState in other contexts like benchmarking.

See #275 (comment)

@dadepo dadepo requested a review from dnut October 7, 2024 13:34
@dnut dnut merged commit 8f4ddae into main Oct 7, 2024
6 checks passed
@dadepo dadepo deleted the dadepo/remove-manual-leak-check branch October 7, 2024 13:52
@@ -1126,14 +1126,14 @@ const ShredInserterTestState = struct {
db: BlockstoreDB,
inserter: ShredInserter,

pub fn init(comptime test_name: []const u8) !ShredInserterTestState {
return initWithLogger(test_name, sig.trace.TestLogger.default.logger());
pub fn init(allocator_: std.mem.Allocator, comptime test_name: []const u8) !ShredInserterTestState {
Copy link
Contributor

@Rexicon226 Rexicon226 Oct 7, 2024

Choose a reason for hiding this comment

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

Surely we could think up a better name here. Why wasn't this just called allocator or gpa?

0xNineteen pushed a commit that referenced this pull request Oct 9, 2024
This PR removes the hardcoded gpa, with manual leak detection from the TestState used in tests.

I believe the reason for this was to have more stack trace frames than what the std.testing.allocator offers, but this proved problematic when using the TestingState in other contexts like benchmarking.

See #275 (comment)
@dnut dnut restored the dadepo/remove-manual-leak-check branch December 20, 2024 12:49
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