From 252e9058d45445dc44d3f818eb8bd6fa95ac826a Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 5 Dec 2018 17:18:06 -0800 Subject: [PATCH] Improve assertion failure message (#14813) Summary: See #14554. I can't figure out how the reported issue can happen. The best next thing is have more information when this happens again. Pull Request resolved: https://github.com/pytorch/pytorch/pull/14813 Differential Revision: D13351908 Pulled By: pietern fbshipit-source-id: 61b30fcae2e34da54329d0893ca4921b6ad60f0d --- test/test_distributed.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_distributed.py b/test/test_distributed.py index 8df327b..637336b 100644 --- a/test/test_distributed.py +++ b/test/test_distributed.py @@ -1009,7 +1009,11 @@ class _DistTestBase(object): else: dist.broadcast(expected_time, dest, group_id) dist.barrier(group_id) - self.assertGreaterEqual(time.time(), expected_time[0]) + self.assertGreaterEqual( + float(time.time()), + float(expected_time[0]), + "destination rank: %d, my rank: %d" % (dest, rank) + + " (if you see this failure, please report in #14554)") # Use higher timeout for the instance where the test runs # against a subgroup and uses a CUDA tensor for expected time. -- 2.7.4