New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 662941 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 663369



Sign in to add a comment

Limit the number of characters in benchmark stories' names

Project Member Reported by eyaich@chromium.org, Nov 7 2016

Issue description

We are seeing the smoothness.tough_fitlers_cases benchmark fail on our mac swarming bots (reference test as well) because of a filename too long error in trace.py.

All tests are passing, but when it tries to generate the traces it fails.

Failing task and relevant log: 
https://chromium-swarm.appspot.com/user/task/3256abd4391d6010


[  PASSED  ] 4 tests.

INFO:root:Try printing formatted exception: <type 'exceptions.IOError'> [Errno 63] File name too long: '/b/s/w/itwKRlFh/tmpE6gIUstelemetry/http___rawgit_com_WebKit_webkit_master_PerformanceTests_Animometer_developer_html_test_interval_20_display_minimal_controller_fixed_frame_rate_50_kalman_process_error_1_kalman_measurement_error_4_time_measurement_performance_suite_name_Animometer_test_name_Focus_complexity_10002016-11-07_02-12-40.html' <traceback object at 0x10ac76c68>

Traceback (most recent call last):
  <module> at /b/s/w/ir4WQjel/tools/perf/run_benchmark:22
    sys.exit(main())
  main at /b/s/w/ir4WQjel/tools/perf/run_benchmark:19
    return benchmark_runner.main(config, [trybot_command.Trybot])
  main at /b/s/w/ir4WQjel/third_party/catapult/telemetry/telemetry/benchmark_runner.py:432
    return command_instance.Run(options)
  Run at /b/s/w/ir4WQjel/third_party/catapult/telemetry/telemetry/benchmark_runner.py:245
    return min(255, self._benchmark().Run(args))
  Run at /b/s/w/ir4WQjel/third_party/catapult/telemetry/telemetry/benchmark.py:91
    return story_runner.RunBenchmark(self, finder_options)
  RunBenchmark at /b/s/w/ir4WQjel/third_party/catapult/telemetry/telemetry/internal/story_runner.py:357
    results.PrintSummary()
  PrintSummary at /b/s/w/ir4WQjel/third_party/catapult/telemetry/telemetry/internal/results/page_test_results.py:339
    self._SerializeTracesToDirPath(self._output_dir)
  _SerializeTracesToDirPath at /b/s/w/ir4WQjel/third_party/catapult/telemetry/telemetry/internal/results/page_test_results.py:377
    fh = value.Serialize(dir_path)
  Serialize at /b/s/w/ir4WQjel/third_party/catapult/telemetry/telemetry/value/trace.py:168
    shutil.copy(self._temp_file.GetAbsPath(), file_path)
  copy at /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py:119
    copyfile(src, dst)
  copyfile at /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py:83
    with open(dst, 'wb') as fdst:
IOError: [Errno 63] File name too long: '/b/s/w/itwKRlFh/tmpE6gIUstelemetry/http___rawgit_com_WebKit_webkit_master_PerformanceTests_Animometer_developer_html_test_interval_20_display_minimal_controller_fixed_frame_rate_50_kalman_process_error_1_kalman_measurement_error_4_time_measurement_performance_suite_name_Animometer_test_name_Focus_complexity_10002016-11-07_02-12-40.html'




This doesn't appear to be failing on any buildbot machines so I am wondering if it is something specific to swarming

The filename looks like it is generated using a tmp path on this line of trace.py: 

https://cs.chromium.org/chromium/src/third_party/catapult/telemetry/telemetry/value/trace.py?q=trace.py&sq=package:chromium&l=168

So maybe the filepath is too long for the swarming bot?  Marc-Antoine have you seen this in swarming before?

Ben/Ethan have you seen this before in tracing results?  Is there a way to shorten this path?



 
Cc: nednguyen@chromium.org
I've never seen this before. But you can see just above, where we use the file-safe name of the page to construct the filename[0], so I think this just happens to be a page with a super long name. We could have Story.file_safe_name truncate long page names in cases like this, but I'd like to maybe understand the root cause of this issue better first. +Ned to chime in on this idea.


[0] https://cs.chromium.org/chromium/src/third_party/catapult/telemetry/telemetry/value/trace.py?q=trace.py&sq=package:chromium&l=161
Here's a MAX_PATH aware implementation of shutil.copy2(). https://github.com/luci/luci-py/blob/master/client/utils/fs.py#L141

the other option is to use at line 161:
file_name = sha1(self.page.file_safe_name).hexdigest()
Ethan do you have a preference for implementation in trace.py?
Blocking: 663369
Emily: I think the core bug is the page's name is too long. In general, if a test in the benchmark name is too long, it will create problems for variety of stack.

I think the right fix here is:
1) Update the page name of (/http___rawgit_com_WebKit_webkit_master_PerformanceTests_Animometer_developer_html_test_interval_20_display_minimal_controller_fixed_frame_rate_50_kalman_process_error_1_kalman_measurement_error_4_time_measurement_performance_suite_name_Animometer_test_name_Focus_complexity_10002016-11-07_02-12-40) to be shorter.
2) Adding some hard check in telemetry that raises error if the name of page is too long.
Emily and I spoke offline about the approach, and we agreed that what Ned is proposing is a good idea. Annie pointed out to me yesterday that regardless of the limit imposed by swarming, we also have the potential to run into this class of problem on the perf dashboard as well: indeed StringProperty is limited to 1500 bytes.

Just to summarize what we talked about, I think that:
1. The right check to insert is in Story's constructor, to make sure that the display_name is under a certain character bound, after which a |name| can be specified for the page that's been giving problems.
2. The hard part is going to be figuring out what an appropriate character limit is.
3. This should not represent an overwhelming amount of work in tools/perf, since according to Emily, the page mentioned is the only story in tools/perf for which we have observed this problem.

Just a last note that when the name of the page in question is updated, we'll probably want to add a note to perf sheriffs, since that has the potential to generate stoppage alerts.
Project Member

Comment 7 by bugdroid1@chromium.org, Nov 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/559454f94fba44e30627bd2265c176061b6851ba

commit 559454f94fba44e30627bd2265c176061b6851ba
Author: eyaich <eyaich@chromium.org>
Date: Wed Nov 09 21:09:09 2016

Truncating tough_filters_cases name

BUG= chromium:662941 

Review-Url: https://codereview.chromium.org/2488013002
Cr-Commit-Position: refs/heads/master@{#431030}

[modify] https://crrev.com/559454f94fba44e30627bd2265c176061b6851ba/tools/perf/page_sets/tough_filters_cases.py

Comment 8 by eyaich@chromium.org, Nov 10 2016

So it seems that the max path is somewhat platform dependent, but since this failed on windows (which is 260 chars) I am going to set the arbitrary limit for now at 250.  I think that is a reasonable length for name.  It will force benchmark owners to give it a name at times instead of relying on the URL.
Keep in mind that 250 may still be too many. The full path discussed above is:
'/b/s/w/itwKRlFh/tmpE6gIUstelemetry/http___rawgit_com_WebKit_webkit_master_PerformanceTests_Animometer_developer_html_test_interval_20_display_minimal_controller_fixed_frame_rate_50_kalman_process_error_1_kalman_measurement_error_4_time_measurement_performance_suite_name_Animometer_test_name_Focus_complexity_10002016-11-07_02-12-40.html' where:

/b/s/w/itwKRlFh/tmpE6gIUstelemetry/ is a prefix and
10002016-11-07_02-12-40.html is a suffix.

So that's 64 characters of padding. Maybe 180 chars is better than 250?
Emily, you're actively working on this, right? If so, can you update the status of the bug to reflect that it's been triaged?
Status: Assigned (was: Untriaged)
This test is actually fixed, I just have one remaining CL that is waiting for review to close this out: https://codereview.chromium.org/2488743006/
Project Member

Comment 13 by bugdroid1@chromium.org, Jan 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/64657ddad6ba9f1c432aee54c0282b1c7aca1e73

commit 64657ddad6ba9f1c432aee54c0282b1c7aca1e73
Author: catapult-deps-roller <catapult-deps-roller@chromium.org>
Date: Fri Jan 06 17:50:13 2017

Roll src/third_party/catapult/ 9e6944a8f..fa1926f93 (23 commits).

https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git/+log/9e6944a8f310..fa1926f937dc

$ git log 9e6944a8f..fa1926f93 --date=short --no-merges --format='%ad %ae %s'
2017-01-06 sullivan Update perf dashboard tooltips to use logdog logs and show status pages.
2017-01-06 charliea Undo unnecessary disables from http://crrev.com/2236493003/
2017-01-05 simonhatch Dashboard - Add some extra logging info for failed auto-bisect.
2017-01-05 nednguyen Revert of Asserting telemetry story display name length for filename creation. (patchset #3 id:40001 of https://codereview.chromium.org/2488743006/ )
2017-01-05 dtu [pinpoint] Fix error message for missing parameters in /isolated.
2017-01-05 benjhayden Update UserModel to an ES6 class.
2017-01-05 benjhayden Configure chai to include stack traces.
2017-01-05 achuith Revert retries for DNS failures.
2017-01-05 benjhayden Finish renaming InteractionRecords to UserExpectations.
2017-01-05 sullivan Add a cached last_row_timestamp to StoppageAlert.
2017-01-05 eakuefner [Dashboard] Factor business logic in AddPointHandler out into AddData method
2017-01-05 simonhatch Dashboard - Bisect output should include percent change if possible.
2017-01-05 jessimb Changing group reports to use an id for multiple keys.
2017-01-05 charliea Replace iterItems() with Object.entries() in a few files
2017-01-05 charliea Use individual power sample for story:power metric
2017-01-05 eakuefner [Dashboard] Eliminate redundancy in AddPointHandler.post
2017-01-05 mikecase Add logcat markers to begin and end of each story.
2017-01-05 charliea Migrate more files from iterItems() to Object methods
2017-01-05 simonhatch Dashboard - Refactor output and clarify bisect failures.
2017-01-04 charliea [catapult android trybot] Make Telemetry tests run on Android
2017-01-04 eyaich Asserting telemetry story display name length for filename creation.
2017-01-04 achuith Browser startup timeout 4 min on ChromeOS, 1 min elsewhere.
2017-01-04 aiolos Unit refactor cl 1: Rename UnitScale to UnitPrefixScale.

BUG= 662941 , 546625 , 665439 ,678282, 665439 , 662941 ,676742

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel
TBR=catapult-sheriff@chromium.org

Review-Url: https://codereview.chromium.org/2613243002
Cr-Commit-Position: refs/heads/master@{#441970}

[modify] https://crrev.com/64657ddad6ba9f1c432aee54c0282b1c7aca1e73/DEPS

Cc: eyaich@chromium.org
Components: Tests>Telemetry
Owner: ----
The original attempt to enforce the characters limit is in https://codereview.chromium.org/2488743006, however, there are multiple problems with landing that CL.

1) If we enforce character limits, we should also enforce it at story, not just page.
2) It's not sufficient to enforce character limit inside the page's constructor due to the fact that display_name can change after the page is constructed.

The reason for that is the logic for forming page's display_name is partly depending on other pages in the page_set (see https://github.com/catapult-project/catapult/blob/6a6f252a320035abf4f8b7d167c21ebf29630f7c/telemetry/telemetry/page/__init__.py#L226). 
In summary, when a page has a file URL, Telemetry looks for all other page with file URL & rename the display name of the the page to be has the common path. 

An example:
story_set = story.StorySet(base_dir=os.path.dirname(__file__))
story_set.AddStory(
    page.Page('file://../../somedir/foo.html', story_set, story_set.base_dir))
print story_set[0].display_name  # Print 'foo.html'
story_set.AddStory(
    page.Page('file://../../otherdir/bar.html', story_set, story_set.base_dir))
print story_set[0].display_name  # Print 'somedir/foo.html


Due to this dynamic nature of display_name, the only place the name character limits can be enforced is inside story_runner loop, which we can be sure that all story_set's stories are fixed.
Status: Available (was: Assigned)
Owner: nedngu...@google.com
Status: Assigned (was: Available)
Project Member

Comment 17 by bugdroid1@chromium.org, Jan 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/21f869f2b2b57484248fec09e3ce56f5352dd08a

commit 21f869f2b2b57484248fec09e3ce56f5352dd08a
Author: nednguyen <nednguyen@google.com>
Date: Fri Jan 13 16:57:53 2017

[tools/perf] Trim down story name that has more than 180 charaters

Fortunately, all of the stories whosed names need to be trim down belong to
one off telemetry script (profile_generator) or Cluster Telemetry. Hence this
CL does not affect any benchmark's story name in production.

BUG= chromium:662941 

Review-Url: https://codereview.chromium.org/2629413002
Cr-Commit-Position: refs/heads/master@{#443585}

[modify] https://crrev.com/21f869f2b2b57484248fec09e3ce56f5352dd08a/tools/perf/page_sets/profile_safe_urls.py
[modify] https://crrev.com/21f869f2b2b57484248fec09e3ce56f5352dd08a/tools/perf/page_sets/top_desktop_sites_2012Q3.py

Project Member

Comment 18 by bugdroid1@chromium.org, Jan 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0f3c36d03565a8931805825c5710b45f5c5e2e70

commit 0f3c36d03565a8931805825c5710b45f5c5e2e70
Author: catapult-deps-roller <catapult-deps-roller@chromium.org>
Date: Sat Jan 14 15:27:45 2017

Roll src/third_party/catapult/ 1bcf49e0a..95b3e83b2 (16 commits).

https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git/+log/1bcf49e0a7eb..95b3e83b284d

$ git log 1bcf49e0a..95b3e83b2 --date=short --no-merges --format='%ad %ae %s'
2017-01-14 nednguyen Keep temporary trace_data.GetTraceFor to unblock catapult roll
2017-01-13 benjhayden Fix a bug in DiagnosticMap.resolveSharedDiagnostics().
2017-01-13 benjhayden Remove dead code Histogram.maxCount.
2017-01-13 benjhayden Update the style of a loop in UserModel.
2017-01-13 benjhayden Remove dead code Histogram.buildFromSamples().
2017-01-13 jessimb Allows a user to create_health_reports.
2017-01-13 benjhayden Extend histogram-set-json-format.md
2017-01-13 benjhayden [histogram-set-table] Ensure that the horizontal scroll bar is always visible.
2017-01-13 sullivan Add a ref_test key to Anomaly entities and surface it in alerts JSON.
2017-01-13 sullivan Speed up queries for getting selected/unselected traces.
2017-01-13 dtu [pinpoint] Swarming service.
2017-01-13 hjd [memory-infra] Remove heap viewer avg size column
2017-01-13 sullivan Rip out old code for finding reference test for an alert.
2017-01-13 nednguyen [Telemetry] Enforce all user stories to have display name under 180 characters
2017-01-13 hjd [tracing] Improve memory_metric breakdown's colors
2017-01-13 nednguyen [Telemetry] Change trace_data to hold a list of raw trace data for each trace part

BUG= 662941 

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel
TBR=catapult-sheriff@chromium.org

Review-Url: https://codereview.chromium.org/2637533005
Cr-Commit-Position: refs/heads/master@{#443798}

[modify] https://crrev.com/0f3c36d03565a8931805825c5710b45f5c5e2e70/DEPS

Status: Fixed (was: Assigned)
Summary: Limit the number of characters in benchmark stories' names (was: swarming smoothness.tough_filters_cases failing in trace.py on filename error)

Sign in to add a comment