diff options
author | 2017-12-27 11:10:26 -0800 | |
---|---|---|
committer | 2017-12-27 11:14:37 -0800 | |
commit | 4469bc1637e23d3c33b39c8befe267eac50a0523 (patch) | |
tree | 68763a69db3460a827c39acc9aab56bc9f9ac7a3 | |
parent | bb4099f816e91cd1a3885aebac7239031a499962 (diff) |
Hack around a bug caused by bazel+tempfile+multiprocessing.
PiperOrigin-RevId: 180207077
-rw-r--r-- | tensorflow/python/keras/_impl/keras/engine/training_test.py | 9 | ||||
-rw-r--r-- | tensorflow/python/keras/_impl/keras/utils/data_utils_test.py | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tensorflow/python/keras/_impl/keras/engine/training_test.py b/tensorflow/python/keras/_impl/keras/engine/training_test.py index 78224814d3..936da39f03 100644 --- a/tensorflow/python/keras/_impl/keras/engine/training_test.py +++ b/tensorflow/python/keras/_impl/keras/engine/training_test.py @@ -1453,4 +1453,13 @@ class TestTrainingWithDataTensors(test.TestCase): if __name__ == '__main__': + # Bazel sets these environment variables to very long paths. + # Tempfile uses them to create long paths, and in turn multiprocessing + # library tries to create sockets named after paths. Delete whatever bazel + # writes to these to avoid tests failing due to socket addresses being too + # long. + for var in ('TMPDIR', 'TMP', 'TEMP'): + if var in os.environ: + del os.environ[var] + test.main() diff --git a/tensorflow/python/keras/_impl/keras/utils/data_utils_test.py b/tensorflow/python/keras/_impl/keras/utils/data_utils_test.py index d541cccbe5..677e98e871 100644 --- a/tensorflow/python/keras/_impl/keras/utils/data_utils_test.py +++ b/tensorflow/python/keras/_impl/keras/utils/data_utils_test.py @@ -299,4 +299,13 @@ class TestEnqueuers(test.TestCase): if __name__ == '__main__': + # Bazel sets these environment variables to very long paths. + # Tempfile uses them to create long paths, and in turn multiprocessing + # library tries to create sockets named after paths. Delete whatever bazel + # writes to these to avoid tests failing due to socket addresses being too + # long. + for var in ('TMPDIR', 'TMP', 'TEMP'): + if var in os.environ: + del os.environ[var] + test.main() |