Repository: flutter
Issue: Check failed: task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()
Labels: platform-ios,engine,P2,team-ios,triaged-ios

I ran the ScenariosTests with tsan (I don't think that's related except that maybe it messed with some timing) and it crashed AFTER the tests were done:

```
Test Suite 'All tests' passed at 2020-07-13 16:35:48.663.
	 Executed 5 tests, with 0 failures (0 unexpected) in 6.007 (6.017) seconds
2020-07-13 16:35:48.671724-0700 Scenarios[18957:27995988] flutter: flutter/system = {"type":"memoryPressure"}
2020-07-13 16:35:48.672007-0700 Scenarios[18957:27995988] [VERBOSE-3:shell.cc(1029)] Check failed: task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread().
CoreSimulator 725.10 - Device: iPhone 8 (563EA154-D457-4CE8-8F0D-D5B9DF05F619) - Runtime: iOS 14.0 (18A5319g) - DeviceType: iPhone 8
(lldb) bt
* thread #39, name = 'Test engine for poppable_screen.5.ui', stop reason = signal SIGABRT
    frame #0: 0x000000010a43933a libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x000000010a57be60 libsystem_pthread.dylib`pthread_kill + 430
    frame #2: 0x00000001010f88c1 libclang_rt.tsan_iossim_dynamic.dylib`wrap_pthread_kill + 321
    frame #3: 0x000000010a18fc54 libsystem_c.dylib`abort + 120
    frame #4: 0x00000001010f7c7c libclang_rt.tsan_iossim_dynamic.dylib`wrap_abort + 108
    frame #5: 0x000000010319e405 Flutter`fml::LogMessage::~LogMessage(this=0x00007e80015ec878) at logging.cc:92:5
    frame #6: 0x000000010319e555 Flutter`fml::LogMessage::~LogMessage(this=0x00007e80015ec878) at logging.cc:63:27
  * frame #7: 0x0000000104271b59 Flutter`flutter::Shell::OnEngineHandlePlatformMessage(this=0x00007b7000056800, message=RefPtr<flutter::PlatformMessage> @ 0x00007e80015ecb48) at shell.cc:1029:3
    frame #8: 0x0000000104210746 Flutter`flutter::Engine::HandlePlatformMessage(this=0x00007b70000b0000, message=RefPtr<flutter::PlatformMessage> @ 0x00007e80015ecb80) at engine.cc:468:15
    frame #9: 0x000000010486ba6d Flutter`flutter::RuntimeController::HandlePlatformMessage(this=0x00007b5800090000, message=<unavailable>) at runtime_controller.cc:304:11
    frame #10: 0x000000010468ccca Flutter`flutter::(anonymous namespace)::SendPlatformMessage(window=0x00007b78000c2418, name="flutter/system", callback=0x00007b6c00001938, data_handle=0x00007b78000c2428) at window.cc:121:37
    frame #11: 0x000000010468cd8a Flutter`tonic::DartDispatcher<tonic::IndicesHolder<0ul, 1ul, 2ul, 3ul>, _Dart_Handle* (*)(_Dart_Handle*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, _Dart_Handle*, _Dart_Handle*)>::Dispatch(this=0x00007e80015eccd8, func=(Flutter`flutter::(anonymous namespace)::SendPlatformMessage(_Dart_Handle*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, _Dart_Handle*, _Dart_Handle*) at window.cc:101))(_Dart_Handle*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, _Dart_Handle*, _Dart_Handle*)) at dart_args.h:131:16
    frame #12: 0x000000010468cabb Flutter`void tonic::DartCallStatic<_Dart_Handle* (*)(_Dart_Handle*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, _Dart_Handle*, _Dart_Handle*)>(func=(Flutter`flutter::(anonymous namespace)::SendPlatformMessage(_Dart_Handle*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, _Dart_Handle*, _Dart_Handle*) at window.cc:101), args=0x00007e80015ecdc0)(_Dart_Handle*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, _Dart_Handle*, _Dart_Handle*), _Dart_NativeArguments*) at dart_args.h:214:11
    frame #13: 0x000000010468c30c Flutter`flutter::(anonymous namespace)::_SendPlatformMessage(args=0x00007e80015ecdc0) at window.cc:131:3
    frame #14: 0x000000010496d231 Flutter`dart::NativeEntry::AutoScopeNativeCallWrapperNoStackCheck(args=0x00007e80015ecdc0, func=(Flutter`flutter::(anonymous namespace)::_SendPlatformMessage(_Dart_NativeArguments*) at window.cc:130))(_Dart_NativeArguments*)) at native_entry.cc:217:7
    frame #15: 0x0000000134e014a4
    frame #16: 0x000000013c126bcc
    frame #17: 0x000000013c1268d3
    frame #18: 0x000000013c149b3f
    frame #19: 0x000000013c12b247
    frame #20: 0x000000013c12aa0d
    frame #21: 0x000000013c1287de
    frame #22: 0x000000013c128330
    frame #23: 0x000000013c127f14
    frame #24: 0x000000013c123697
    frame #25: 0x000000013c1233bd
    frame #26: 0x000000013c122853
    frame #27: 0x000000013c127cc5
    frame #28: 0x000000013c127b5f
    frame #29: 0x000000013c127236
    frame #30: 0x0000000134e016ef
    frame #31: 0x00000001048fecb2 Flutter`dart::DartEntry::InvokeCode(code=0x0000000134d84ae1, arguments_descriptor=0x00007b78000c3730, arguments=0x00007b78000c36a0, thread=0x0000000134d87d11) at dart_entry.cc:205:7
    frame #32: 0x00000001048fea17 Flutter`dart::DartEntry::InvokeFunction(function=0x00007b78000c36f0, arguments=<unavailable>, arguments_descriptor=<unavailable>, current_sp=<unavailable>) at dart_entry.cc:171:10
    frame #33: 0x00000001049ab62f Flutter`dart::Library::Invoke(this=0x00007b78000c3690, function_name=0x00007b78000c3680, args=0x00007b78000c36a0, arg_names=0x00007b6c00001588, respect_reflectable=false, check_is_entrypoint=<unavailable>) const at object.cc:12522:10
    frame #34: 0x0000000104cffecc Flutter`::Dart_Invoke(target=<unavailable>, name=<unavailable>, number_of_arguments=<unavailable>, arguments=<unavailable>) at dart_api_impl.cc:4650:16
    frame #35: 0x0000000104321300 Flutter`tonic::DartInvokeField(target=0x00007b78000c0068, name="_dispatchPlatformMessage", args=([0] = 0x00007b78000c3020, [1] = 0x00007b78000c3018, [2] = 0x00007b78000c3028)) at dart_invoke.cc:16:10
    frame #36: 0x000000010468b108 Flutter`flutter::Window::DispatchPlatformMessage(this=0x00007b3800047420, message=RefPtr<flutter::PlatformMessage> @ 0x00007e80015eda48) at window.cc:299:7
    frame #37: 0x000000010486b666 Flutter`flutter::RuntimeController::DispatchPlatformMessage(this=0x00007b5800090000, message=RefPtr<flutter::PlatformMessage> @ 0x00007e80015edbf0) at runtime_controller.cc:245:13
    frame #38: 0x0000000104211039 Flutter`flutter::Engine::DispatchPlatformMessage(this=0x00007b70000b0000, message=RefPtr<flutter::PlatformMessage> @ 0x00007e80015edc20) at engine.cc:303:28
    frame #39: 0x00000001042b9432 Flutter`flutter::Shell::OnPlatformViewDispatchPlatformMessage(this=0x00007b0c00083ee8)::$_21::operator()() const at shell.cc:804:19
    frame #40: 0x00000001042b93ad Flutter`decltype(__f=0x00007b0c00083ee8)::$_21&>(fp)()) std::__1::__invoke<flutter::Shell::OnPlatformViewDispatchPlatformMessage(fml::RefPtr<flutter::PlatformMessage>)::$_21&>(flutter::Shell::OnPlatformViewDispatchPlatformMessage(fml::RefPtr<flutter::PlatformMessage>)::$_21&) at type_traits:3545:1
    frame #41: 0x00000001042b935d Flutter`void std::__1::__invoke_void_return_wrapper<void>::__call<flutter::Shell::OnPlatformViewDispatchPlatformMessage(__args=0x00007b0c00083ee8)::$_21&>(flutter::Shell::OnPlatformViewDispatchPlatformMessage(fml::RefPtr<flutter::PlatformMessage>)::$_21&) at __functional_base:348:9
    frame #42: 0x00000001042b932d Flutter`std::__1::__function::__alloc_func<flutter::Shell::OnPlatformViewDispatchPlatformMessage(fml::RefPtr<flutter::PlatformMessage>)::$_21, std::__1::allocator<flutter::Shell::OnPlatformViewDispatchPlatformMessage(fml::RefPtr<flutter::PlatformMessage>)::$_21>, void ()>::operator(this=0x00007b0c00083ee8)() at functional:1550:16
    frame #43: 0x00000001042b81ae Flutter`std::__1::__function::__func<flutter::Shell::OnPlatformViewDispatchPlatformMessage(fml::RefPtr<flutter::PlatformMessage>)::$_21, std::__1::allocator<flutter::Shell::OnPlatformViewDispatchPlatformMessage(fml::RefPtr<flutter::PlatformMessage>)::$_21>, void ()>::operator(this=0x00007b0c00083ee0)() at functional:1724:12
    frame #44: 0x000000010318a975 Flutter`std::__1::__function::__value_func<void ()>::operator(this=0x00007b0c000a2930)() const at functional:1877:16
    frame #45: 0x0000000103188a75 Flutter`std::__1::function<void ()>::operator(this= Lambda in File shell.cc at Line 802)() const at functional:2549:12
    frame #46: 0x00000001031a68f2 Flutter`fml::MessageLoopImpl::FlushTasks(this=0x00007b100003c580, type=kAll) at message_loop_impl.cc:127:5
    frame #47: 0x00000001031a67ca Flutter`fml::MessageLoopImpl::RunExpiredTasksNow(this=0x00007b100003c580) at message_loop_impl.cc:137:3
    frame #48: 0x00000001031c5885 Flutter`fml::MessageLoopDarwin::OnTimerFire(timer=0x00007b300006ffc0, loop=0x00007b100003c580) at message_loop_darwin.mm:75:11
    frame #49: 0x00000001027ea868 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    frame #50: 0x00000001027ea3e4 CoreFoundation`__CFRunLoopDoTimer + 870
    frame #51: 0x00000001027e9af3 CoreFoundation`__CFRunLoopDoTimers + 243
    frame #52: 0x00000001027e45fb CoreFoundation`__CFRunLoopRun + 1933
    frame #53: 0x00000001027e3aba CoreFoundation`CFRunLoopRunSpecific + 538
    frame #54: 0x00000001031c5bbd Flutter`fml::MessageLoopDarwin::Run(this=0x00007b100003c580) at message_loop_darwin.mm:46:20
    frame #55: 0x00000001031a6715 Flutter`fml::MessageLoopImpl::DoRun(this=0x00007b100003c580) at message_loop_impl.cc:96:3
    frame #56: 0x00000001031a4dfd Flutter`fml::MessageLoop::Run(this=0x00007b040000a4c0) at message_loop.cc:49:10
    frame #57: 0x00000001031be164 Flutter`fml::Thread::Thread(this=0x00007b0c000854a8)::$_0::operator()() const at thread.cc:34:10
    frame #58: 0x00000001031be09d Flutter`decltype(__f=0x00007b0c000854a8)::$_0>(fp)()) std::__1::__invoke<fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0>(fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0&&) at type_traits:3545:1
    frame #59: 0x00000001031be005 Flutter`void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0>(__t=size=2, (null)=__tuple_indices<> @ 0x00007e80015eff38)::$_0>&, std::__1::__tuple_indices<>) at thread:273:5
    frame #60: 0x00000001031bd85b Flutter`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0> >(__vp=0x00007b0c000854a0) at thread:284:5
    frame #61: 0x00000001010f512c libclang_rt.tsan_iossim_dynamic.dylib`__tsan_thread_start_func + 140
    frame #62: 0x000000010a57c109 libsystem_pthread.dylib`_pthread_start + 148
    frame #63: 0x000000010a577b8b libsystem_pthread.dylib`thread_start + 15
```
memoryPressure notification?

Running Xcode 12 beta 2.