295ea609c6267ed2a6b0521000a266e3962f6289,tests/python/pants_test/base/test_exception_sink.py,TestExceptionSink,test_backup_logging_on_fatal_error,#TestExceptionSink#,61
Before Change
sink = self._gen_sink_subclass()
with self.captured_logging(level=logging.ERROR) as captured:
with temporary_dir() as tmpdir:
exc_log_path = os.path.join(tmpdir, "logs", "exceptions.log")
touch(exc_log_path)
// Make the exception log file unreadable.
os.chmod(exc_log_path, 0)
sink.set_destination(tmpdir)
sink.log_exception("XXX")
After Change
with self.captured_logging(level=logging.ERROR) as captured:
with temporary_dir() as tmpdir:
sink.reset_log_location(tmpdir)
with mock.patch.object(sink, "_try_write_with_flush", autospec=sink) as mock_write:
mock_write.side_effect = ExceptionSink.ExceptionSinkError("fake write failure")
sink.log_exception("XXX")
errors = list(captured.errors())
self.assertEqual(2, len(errors))
def format_log_rx(log_file_type):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: pantsbuild/pants
Commit Name: 295ea609c6267ed2a6b0521000a266e3962f6289
Time: 2018-10-08
Author: 1305167+cosmicexplorer@users.noreply.github.com
File Name: tests/python/pants_test/base/test_exception_sink.py
Class Name: TestExceptionSink
Method Name: test_backup_logging_on_fatal_error
Project Name: pantsbuild/pants
Commit Name: e7b9ce76c065eb9ba46791fbef67a4961150dd2c
Time: 2015-05-18
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/java/distribution/test_distribution.py
Class Name: MockDistributionTest
Method Name: distribution
Project Name: pantsbuild/pants
Commit Name: 0aba5673cd9a994961bbdabde635431922d37a77
Time: 2019-04-16
Author: 46382106+patliu85@users.noreply.github.com
File Name: tests/python/pants_test/pantsd/test_pantsd_integration.py
Class Name: TestPantsDaemonIntegration
Method Name: test_pantsd_invalidation_file_tracking