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

Fix error when uploading stats to stats storage #8233

Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/python/pants/goal/pantsd_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(self):
self.scheduler_metrics = {}

def set_scheduler_metrics(self, scheduler_metrics):
self.scheduler_metrics = scheduler_metrics
self.scheduler_metrics = {key: value for (key, value) in scheduler_metrics.items() if key != "engine_workunits"}

def set_target_root_size(self, size):
self.scheduler_metrics['target_root_size'] = size
Expand Down
1 change: 1 addition & 0 deletions tests/python/pants_test/backend/native/subsystems/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ python_tests(
'tests/python/pants_test/subsystem:subsystem_utils',
],
tags={'platform_specific_behavior'},
timeout=120,
)
4 changes: 4 additions & 0 deletions tests/python/pants_test/goal/test_run_tracker_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def test_stats_local_json_file_v1(self):
'test',
'--run-tracker-stats-local-json-file={}'.format(tmpfile),
'--run-tracker-stats-version=1',
'--reporting-zipkin-trace-v2',
'--run-tracker-stats-option-scopes-to-record=["GLOBAL", "GLOBAL^v2_ui", "compile.rsc^capture_classpath"]',
'testprojects/src/java/org/pantsbuild/testproject/unicode/main',
])
Expand All @@ -31,6 +32,7 @@ def test_stats_local_json_file_v1(self):
self.assertIn('pantsd_stats', stats_json)
self.assertIn('recorded_options', stats_json)
self.assertIn('GLOBAL', stats_json['recorded_options'])
self.assertNotIn('engine_workunits', stats_json['pantsd_stats'])
self.assertIs(stats_json['recorded_options']['GLOBAL']['v2_ui'], False)
self.assertEqual(stats_json['recorded_options']['GLOBAL']['level'], 'info')
self.assertIs(stats_json['recorded_options']['GLOBAL^v2_ui'], False)
Expand All @@ -42,6 +44,7 @@ def test_stats_local_json_file_v2(self):
'test',
'--run-tracker-stats-local-json-file={}'.format(tmpfile),
'--run-tracker-stats-version=2',
'--reporting-zipkin-trace-v2',
'testprojects/src/java/org/pantsbuild/testproject/unicode/main',
])
self.assert_success(pants_run)
Expand All @@ -52,6 +55,7 @@ def test_stats_local_json_file_v2(self):
self.assertIn('run_info', stats_json)
self.assertIn('pantsd_stats', stats_json)
self.assertIn('workunits', stats_json)
self.assertNotIn('engine_workunits', stats_json['pantsd_stats'])

def test_workunit_failure(self):
pants_run = self.run_pants([
Expand Down