title: parallel tests on Mac OS X Catalina crash with Postgres
body: <p>After upgrading to Mac OS X Catalina my parallel django tests cash.</p>
  
  <p>With this in settings I get a crash, without them (when sqlite is used everything is fine)</p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql',
          'NAME': 'xx',
          'USER': 'xx',
          'PASSWORD': 'xx',
          'HOST': '127.0.0.1',
          'PORT': '5432',
      }
  }
  </code></pre>
  
  <p>Execution command is:
  python manage.py test --settings=app.settings.test --parallel</p>
  
  <p>The crash report contains this:</p>
  
  <pre><code>Process:               Python [30650]
  Path:                  /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
  Identifier:            Python
  Version:               3.7.5 (3.7.5)
  Code Type:             X86-64 (Native)
  Parent Process:        Python [30634]
  Responsible:           Terminal [1592]
  User ID:               501
  
  Date/Time:             2019-12-15 10:04:41.315 -0800
  OS Version:            Mac OS X 10.15.2 (19C57)
  Report Version:        12
  Bridge OS Version:     4.2 (17P2551)
  Anonymous UUID:        9B583AD7-1D7E-AA15-3286-DADFF9B92A49
  
  Sleep/Wake UUID:       41900DFA-568F-4B5B-BFA4-0C5FF8D8C05F
  
  Time Awake Since Boot: 54000 seconds
  Time Since Wake:       2000 seconds
  
  System Integrity Protection: enabled
  
  Crashed Thread:        0  Dispatch queue: com.apple.main-thread
  
  Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
  Exception Codes:       KERN_INVALID_ADDRESS at 0x000000011554baba
  Exception Note:        EXC_CORPSE_NOTIFY
  
  Termination Signal:    Segmentation fault: 11
  Termination Reason:    Namespace SIGNAL, Code 0xb
  Terminating Process:   exc handler [30650]
  
  VM Regions Near 0x11554baba:
      VM_ALLOCATE            000000011550b000-000000011554b000 [  256K] rw-/rwx SM=COW  
  --&gt; 
      shared memory          000000011558b000-000000011558f000 [   16K] r--/r-- SM=SHM  
  
  Application Specific Information:
  *** multi-threaded process forked ***
  crashed on child side of fork pre-exec
  
  Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
  0   libsystem_trace.dylib           0x00007fff6ee9fc45 _os_log_preferences_refresh + 75
  1   libsystem_trace.dylib           0x00007fff6eea0624 os_log_type_enabled + 618
  2   com.apple.security              0x00007fff43daa6ad Security::DLDbListCFPref::loadPropertyList(bool) + 341
  3   com.apple.security              0x00007fff43fee5f4 Security::KeychainCore::StorageManager::getSearchList(std::__1::vector&lt;Security::KeychainCore::Keychain, std::__1::allocator&lt;Security::KeychainCore::Keychain&gt; &gt;&amp;) + 142
  4   com.apple.security              0x00007fff43ff0704 Security::KeychainCore::StorageManager::optionalSearchList(void const*, std::__1::vector&lt;Security::KeychainCore::Keychain, std::__1::allocator&lt;Security::KeychainCore::Keychain&gt; &gt;&amp;) + 114
  5   com.apple.security              0x00007fff43fb3ea5 SecIdentitySearchCreate + 139
  6   com.apple.security              0x00007fff43fc1548 _CreateSecItemParamsFromDictionary(__CFDictionary const*, int*) + 4109
  7   com.apple.security              0x00007fff43fbf73b SecItemCopyMatching_osx(__CFDictionary const*, void const**) + 104
  8   com.apple.security              0x00007fff43fc3024 SecItemCopyMatching + 338
  9   com.apple.Heimdal               0x00007fff5976f303 keychain_query + 531
  10  com.apple.Heimdal               0x00007fff5976cf4c hx509_certs_find + 92
  11  com.apple.Heimdal               0x00007fff5972bb52 _krb5_pk_find_cert + 466
  12  com.apple.GSS                   0x00007fff3a2539bb _gsspku2u_acquire_cred + 619
  13  com.apple.GSS                   0x00007fff3a238c1c gss_acquire_cred + 940
  14  libpq.5.dylib                   0x00000001054526e3 pg_GSS_have_cred_cache + 54
  15  libpq.5.dylib                   0x0000000105440eb0 PQconnectPoll + 6356
  16  libpq.5.dylib                   0x000000010543e026 connectDBComplete + 231
  17  libpq.5.dylib                   0x000000010543e1ad PQconnectdb + 36
  18  _psycopg.cpython-37m-darwin.so  0x00000001053fe587 conn_connect + 135
  19  _psycopg.cpython-37m-darwin.so  0x00000001053ffbc0 connection_init + 336
  20  org.python.python               0x00000001033dc7ee type_call + 172
  21  org.python.python               0x00000001033a1453 _PyObject_FastCallDict + 264
  22  org.python.python               0x00000001033a292f _PyObject_CallFunctionVa + 207
  23  org.python.python               0x00000001033a2a90 _PyObject_CallFunction_SizeT + 129
  24  _psycopg.cpython-37m-darwin.so  0x00000001053f98e0 psyco_connect + 192
  25  org.python.python               0x00000001033a1cda PyCFunction_Call + 208
  26  org.python.python               0x000000010342f70e _PyEval_EvalFrameDefault + 7738
  27  org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  28  org.python.python               0x00000001033a1678 _PyFunction_FastCallDict + 444
  29  org.python.python               0x000000010342f627 _PyEval_EvalFrameDefault + 7507
  30  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  31  org.python.python               0x00000001034363d5 call_function + 737
  32  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  33  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  34  org.python.python               0x00000001034363d5 call_function + 737
  35  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  36  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  37  org.python.python               0x00000001034363d5 call_function + 737
  38  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  39  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  40  org.python.python               0x00000001034363d5 call_function + 737
  41  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  42  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  43  org.python.python               0x00000001034363d5 call_function + 737
  44  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  45  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  46  org.python.python               0x00000001034363d5 call_function + 737
  47  org.python.python               0x000000010342f343 _PyEval_EvalFrameDefault + 6767
  48  org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  49  org.python.python               0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
  50  org.python.python               0x00000001034363d5 call_function + 737
  51  org.python.python               0x000000010342f3de _PyEval_EvalFrameDefault + 6922
  52  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  53  org.python.python               0x00000001034363d5 call_function + 737
  54  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  55  org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  56  org.python.python               0x00000001033a1678 _PyFunction_FastCallDict + 444
  57  org.python.python               0x00000001033a277f _PyObject_Call_Prepend + 131
  58  org.python.python               0x00000001033a1b45 PyObject_Call + 136
  59  org.python.python               0x000000010342f627 _PyEval_EvalFrameDefault + 7507
  60  org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  61  org.python.python               0x00000001033a1678 _PyFunction_FastCallDict + 444
  62  org.python.python               0x00000001033a277f _PyObject_Call_Prepend + 131
  63  org.python.python               0x00000001033df0ce slot_tp_call + 71
  64  org.python.python               0x00000001033a18ae _PyObject_FastCallKeywords + 358
  65  org.python.python               0x00000001034363ce call_function + 730
  66  org.python.python               0x000000010342f3de _PyEval_EvalFrameDefault + 6922
  67  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  68  org.python.python               0x00000001034363d5 call_function + 737
  69  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  70  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  71  org.python.python               0x000000010342f627 _PyEval_EvalFrameDefault + 7507
  72  org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  73  org.python.python               0x00000001033a1678 _PyFunction_FastCallDict + 444
  74  org.python.python               0x000000010342f627 _PyEval_EvalFrameDefault + 7507
  75  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  76  org.python.python               0x00000001034363d5 call_function + 737
  77  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  78  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  79  org.python.python               0x00000001034363d5 call_function + 737
  80  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  81  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  82  org.python.python               0x00000001034363d5 call_function + 737
  83  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  84  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  85  org.python.python               0x00000001033a277f _PyObject_Call_Prepend + 131
  86  org.python.python               0x00000001033dfac2 slot_tp_init + 80
  87  org.python.python               0x00000001033dc7ee type_call + 172
  88  org.python.python               0x00000001033a18ae _PyObject_FastCallKeywords + 358
  89  org.python.python               0x00000001034363ce call_function + 730
  90  org.python.python               0x000000010342f3de _PyEval_EvalFrameDefault + 6922
  91  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  92  org.python.python               0x00000001034363d5 call_function + 737
  93  org.python.python               0x000000010342f343 _PyEval_EvalFrameDefault + 6767
  94  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  95  org.python.python               0x00000001034363d5 call_function + 737
  96  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  97  org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  98  org.python.python               0x00000001034363d5 call_function + 737
  99  org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  100 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  101 org.python.python               0x00000001033a1678 _PyFunction_FastCallDict + 444
  102 org.python.python               0x00000001033a277f _PyObject_Call_Prepend + 131
  103 org.python.python               0x00000001033dfac2 slot_tp_init + 80
  104 org.python.python               0x00000001033dc7ee type_call + 172
  105 org.python.python               0x00000001033a18ae _PyObject_FastCallKeywords + 358
  106 org.python.python               0x00000001034363ce call_function + 730
  107 org.python.python               0x000000010342f486 _PyEval_EvalFrameDefault + 7090
  108 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  109 org.python.python               0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
  110 org.python.python               0x00000001034363d5 call_function + 737
  111 org.python.python               0x000000010342f486 _PyEval_EvalFrameDefault + 7090
  112 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  113 org.python.python               0x00000001033a1678 _PyFunction_FastCallDict + 444
  114 org.python.python               0x00000001033a277f _PyObject_Call_Prepend + 131
  115 org.python.python               0x00000001033a1b45 PyObject_Call + 136
  116 org.python.python               0x000000010342f627 _PyEval_EvalFrameDefault + 7507
  117 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  118 org.python.python               0x00000001033a1678 _PyFunction_FastCallDict + 444
  119 org.python.python               0x00000001033a277f _PyObject_Call_Prepend + 131
  120 org.python.python               0x00000001033df0ce slot_tp_call + 71
  121 org.python.python               0x00000001033a18ae _PyObject_FastCallKeywords + 358
  122 org.python.python               0x00000001034363ce call_function + 730
  123 org.python.python               0x000000010342f3de _PyEval_EvalFrameDefault + 6922
  124 org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  125 org.python.python               0x00000001034363d5 call_function + 737
  126 org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  127 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  128 org.python.python               0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
  129 org.python.python               0x00000001034363d5 call_function + 737
  130 org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  131 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  132 org.python.python               0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
  133 org.python.python               0x00000001034363d5 call_function + 737
  134 org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  135 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  136 org.python.python               0x00000001033a1678 _PyFunction_FastCallDict + 444
  137 org.python.python               0x00000001033a277f _PyObject_Call_Prepend + 131
  138 org.python.python               0x00000001033a1b45 PyObject_Call + 136
  139 org.python.python               0x000000010342f627 _PyEval_EvalFrameDefault + 7507
  140 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  141 org.python.python               0x00000001033a1678 _PyFunction_FastCallDict + 444
  142 org.python.python               0x00000001033a277f _PyObject_Call_Prepend + 131
  143 org.python.python               0x00000001033a1b45 PyObject_Call + 136
  144 org.python.python               0x000000010342f627 _PyEval_EvalFrameDefault + 7507
  145 org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  146 org.python.python               0x00000001034363d5 call_function + 737
  147 org.python.python               0x000000010342f343 _PyEval_EvalFrameDefault + 6767
  148 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  149 org.python.python               0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
  150 org.python.python               0x00000001034363d5 call_function + 737
  151 org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  152 org.python.python               0x00000001033a1e0c function_code_fastcall + 106
  153 org.python.python               0x00000001034363d5 call_function + 737
  154 org.python.python               0x000000010342f32a _PyEval_EvalFrameDefault + 6742
  155 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  156 org.python.python               0x00000001033a1a00 _PyFunction_FastCallKeywords + 212
  157 org.python.python               0x00000001034363d5 call_function + 737
  158 org.python.python               0x000000010342f3de _PyEval_EvalFrameDefault + 6922
  159 org.python.python               0x0000000103436bc9 _PyEval_EvalCodeWithName + 1698
  160 org.python.python               0x000000010342d831 PyEval_EvalCode + 51
  161 org.python.python               0x000000010345bc3c run_mod + 54
  162 org.python.python               0x000000010345ac6f PyRun_FileExFlags + 160
  163 org.python.python               0x000000010345a326 PyRun_SimpleFileExFlags + 270
  164 org.python.python               0x0000000103472b2e pymain_main + 5445
  165 org.python.python               0x000000010347319c _Py_UnixMain + 56
  166 libdyld.dylib                   0x00007fff6ec827fd start + 1
  
  Thread 0 crashed with X86 Thread State (64-bit):
    rax: 0x000000011554bab8  rbx: 0x0000000000000000  rcx: 0x00000001072cee6c  rdx: 0x0000000000000000
    rdi: 0x00007ff2617da290  rsi: 0x0000000000000001  rbp: 0x00007ffeec87a340  rsp: 0x00007ffeec879f00
     r8: 0x2bf4e2fa4089247b   r9: 0x00000000a5baadb8  r10: 0x00000000a5baadb9  r11: 0x000000001c2a1c07
    r12: 0x000000011554babc  r13: 0x0000000000000024  r14: 0x0000000000000002  r15: 0x00007ff2617da290
    rip: 0x00007fff6ee9fc45  rfl: 0x0000000000010206  cr2: 0x000000011554baba
   ...
  </code></pre>