Commit e19d9450 authored by William Chargin's avatar William Chargin Committed by TensorFlower Gardener
Browse files

Fix profile plugin output directory on Windows

Windows tests are (correctly, not spuriously) failing with

    tensorflow.python.framework.errors_impl.InvalidArgumentError: Failed to create a directory: T:\tmp\<snip>\tmp4vh90go6\tb/plugins/profile\2019-02-22_15:46:14; Invalid argument

Because the profiler plugin?s director is hard-coded to use a `/`
separator rather than the platform-specific separator. The root cause is
<#26021>.

The astute reader will note that there are _two_ forward slashes in the
above log: `?\tb/plugins/profile/?`. This patch fixes the second, but
whence the first? In fact, it is but a trick of the light. The calling
code actually asks to create `?\tb\plugins/profile/?`, but after the
implementation of `CreateRecursiveDirectory` creates the `?\tb`
directory, it adjoins `/plugins` (hard-coded forward slash) to the
running path to form the next directory to be created. This is harmless;
it just makes the log message a bit subtle to understand.

Furthermore, the colon in the last component of the directory name is an
invalid path character on Windows. This patch also changes the colons to
hyphens.

Tested:
This fixes the `callbacks_test` and `callbacks_v1_test` test cases on
the Windows Kokoro build. (Other tests on that build still fail.)
PiperOrigin-RevId: 235587998
parent 7dab0236
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment