Question: I have override startTest and stopTest from unittest TextTestResult class and used it in my custom test runner. It’s working correctly in normal scenario but not working correctly when using with --parallel flag. I tried to debug and found the time elapsed b/w startTest and stopTest is coming very very small. Like 4.8000000000492093e-05 which is incorrect. Would someone please tell me is it the right hooks for --parallel flag or I have to use some another hook? Steps to reproduce: Let's assume the project name of django is project and the app is app  create custom_test_runner.py in your django project directory and add below code:  from time import perf_counter from unittest import TextTestResult, TextTestRunner from django.test.runner import DiscoverRunner class CustomTestRunnerTextTestResult(TextTestResult): def __init__(self, stream, descriptions, verbosity): super(CustomTestRunnerTextTestResult, self).__init__(stream, descriptions, verbosity) def startTest(self, test): self.start_time = perf_counter() super(CustomTestRunnerTextTestResult, self).startTest(test) def stopTest(self, test): super(CustomTestRunnerTextTestResult, self).stopTest(test) print(f"Time elapsed {str(test)} for {perf_counter() - self.start_time}") class CustomTestRunnerTextTestRunner(TextTestRunner): def __init__(self, **kwargs): super().__init__(**kwargs) resultclass = CustomTestRunnerTextTestResult class CustomTestRunnerTestRunner(DiscoverRunner): def __init__(self, **kwargs): super(CustomTestRunnerTestRunner, self).__init__(**kwargs) test_runner = CustomTestRunnerTextTestRunner   create test_custom_test_runner.py in tests folder and add the below code:  import time from django.test import TestCase class Test1(TestCase): def test_1(self): time.sleep(2) class Test2(TestCase): def test_2(self): time.sleep(2)   in your settings.py add below code  TEST_RUNNER = "project.custom_test_runner.CustomTestRunnerTestRunner"   Now, run python manage.py test app.tests.test_custom_test_runner --parallel  You'll get very small time interval like this: .Time elapsed test_1 (app.tests.test_custom_test_runner.Test1) for 0.00034683300000004635 .Time elapsed test_2 (app.tests.test_custom_test_runner.Test2) for 0.0002126670000004438 ---------------------------------------------------------------------- Ran 2 tests in 2.095s  But if you ran it without --parallel flag you'll get: .Time elapsed test_1 (app.tests.test_custom_test_runner.Test1) for 2.005363042 .Time elapsed test_2 (app.tests.test_custom_test_runner.Test2) for 2.0043795000000006 ---------------------------------------------------------------------- Ran 2 tests in 4.027s  Django Version: 3.2.14

Answer: test_runner.resultclass (CustomTestRunnerTextTestResult) methods are not called in real-time if using --parallel flag. Rather, parallel_test_suite.runnerclass.resultclass (RemoteTestResult) methods are called, which queue events (method calls to test_runner.resultclass) to be dispatched together by parallel_test_suite (ParallelTestSuite) after each test is completed. Django ticket, Oct 2020: https://code.djangoproject.com/ticket/32140 (closed as needsinfo)  Here's one way to support your requirement:  Instead of calling perf_counter() directly, implement and call self._get_time(), which will try to return the time marked by a RemoteTestResult subclass. Provide a method for the RemoteTestResult subclass to mark the time via events.  class CustomTestRunnerTextTestResult(TextTestResult): def __init__(self, stream, descriptions, verbosity): super(CustomTestRunnerTextTestResult, self).__init__(stream, descriptions, verbosity) self._marked_remote_time = None # Add this def mark_remote_time(self, _test, remote_time): # For CustomTestRunnerRemoteTestResult events # Add this method self._marked_remote_time = remote_time def _get_time(self): # Add this method return self._marked_remote_time or perf_counter() def startTest(self, test): # self.start_time = perf_counter() # Change this self.start_time = self._get_time() # to this super(CustomTestRunnerTextTestResult, self).startTest(test) def stopTest(self, test): super(CustomTestRunnerTextTestResult, self).stopTest(test) # print(f"Time elapsed {str(test)} for {perf_counter() - self.start_time}") # Change this print(f"Time elapsed {str(test)} for {self._get_time() - self.start_time}") # to this   Implement the RemoteTestResult subclass, which marks the time via events.  from django.test.runner import RemoteTestResult class CustomTestRunnerRemoteTestResult(RemoteTestResult): def startTest(self, test): self.events.append(("mark_remote_time", self.test_index, perf_counter())) super().startTest(test) # Does self.events.append(("startTest", self.test_index)) def stopTest(self, test): self.events.append(("mark_remote_time", self.test_index, perf_counter())) super().stopTest(test) # Does self.events.append(("stopTest", self.test_index))   Pass the RemoteTestResult subclass to parallel_test_suite.runnerclass constructor.  from functools import partial class CustomTestRunnerTestRunner(DiscoverRunner): def __init__(self, **kwargs): super(CustomTestRunnerTestRunner, self).__init__(**kwargs) self.parallel_test_suite.runner_class = partial( # Add this self.parallel_test_suite.runner_class, resultclass=CustomTestRunnerRemoteTestResult, ) test_runner = CustomTestRunnerTextTestRunner