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

Detect a memory leak as a test failure #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/grntest/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def n_failed_tests
@failed_tests.size
end

def n_leaked_tests
@n_leaked_tests
end

def on_test_finish
@n_tests += 1
end
Expand Down Expand Up @@ -181,6 +185,7 @@ def run_test(test_script_path, test_name)

runner = TestRunner.new(@tester, self)
return true if runner.run
return false if @result.n_leaked_tests > 0
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this?
It seems that TestRunner#run returns false when leaked test exists: https://github.com/groonga/grntest/blob/master/lib/grntest/test-runner.rb#L111


if n < @tester.n_retries and not interruptted?
@result.cancel_test_failure(test_name)
Expand Down