Skip to content

Conversation

@gimki
Copy link
Contributor

@gimki gimki commented Mar 1, 2021

There was a bug introduced from Issue #15 where we attempt to sample
right after flushing profiles even is_profiling_in_progress has been
reset to False already

Issue #, if available:
#15

Description of changes:

We would not attempt to sample after flushing the profile given that we have also set is_profiling_in_progress to False already.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Colman Yau added 2 commits March 1, 2021 15:09
There was a bug introduced from Issue #15 where we attempt to sample
right after flushing profiles even is_profiling_in_progress has been
reset to False already
@gimki gimki linked an issue Mar 2, 2021 that may be closed by this pull request
profiler.stop()

assert wrapped_add.call_count >= 3
# We should see at least 2 sample in 4 seconds as the sequence should happen in the order of
Copy link
Contributor

Choose a reason for hiding this comment

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

*samples

self.profiler_runner._profiling_command()
self.mock_collector.refresh_configuration.assert_called_once()

def test_when_it_does_not_sample_when_it_reports(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be renamed to "when_it_reports_it_does_not_sample"?

def test_when_it_does_not_sample_when_it_reports(self):
self.is_time_to_report = True

assert(self.profiler_runner._profiling_command())
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: no parenthesis.

Copy link
Contributor

@mirelap-amazon mirelap-amazon left a comment

Choose a reason for hiding this comment

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

Minor comments, please see below.

@gimki gimki merged commit 37d4be6 into main Mar 2, 2021
@PapaPedro PapaPedro deleted the issue-15-fix branch March 5, 2021 11:02
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.

Report profile before sample to avoid incorrect profile end time

2 participants