diff --git a/engine/src/flutter/BUILD.gn b/engine/src/flutter/BUILD.gn index fd0073127c..e09625e175 100644 --- a/engine/src/flutter/BUILD.gn +++ b/engine/src/flutter/BUILD.gn @@ -53,6 +53,23 @@ config("export_dynamic_symbols") { } } +config("export_dynamic_test_symbols") { + # See comment in :export_dynamic_symbols. + # This config exposes an additional symbol meant for flutter_tester. + if (is_linux || is_fuchsia) { + inputs = [ "//flutter/common/exported_test_symbols.sym" ] + ldflags = [ "-Wl,--dynamic-list=" + rebase_path(inputs[0], root_build_dir) ] + } else if (is_mac) { + inputs = [ "//flutter/common/exported_test_symbols_mac.sym" ] + ldflags = [ + "-Xlinker", + "-exported_symbols_list", + "-Xlinker", + rebase_path(inputs[0], root_build_dir), + ] + } +} + group("flutter") { testonly = true diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index 8485580423..6b9db5d1ef 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -7414,6 +7414,8 @@ FILE: ../../../flutter/benchmarking/library.h FILE: ../../../flutter/common/constants.h FILE: ../../../flutter/common/exported_symbols.sym FILE: ../../../flutter/common/exported_symbols_mac.sym +FILE: ../../../flutter/common/exported_test_symbols.sym +FILE: ../../../flutter/common/exported_test_symbols_mac.sym FILE: ../../../flutter/common/graphics/gl_context_switch.cc FILE: ../../../flutter/common/graphics/gl_context_switch.h FILE: ../../../flutter/common/graphics/msaa_sample_count.h diff --git a/engine/src/flutter/common/exported_test_symbols.sym b/engine/src/flutter/common/exported_test_symbols.sym new file mode 100644 index 0000000000..feb9f831d5 --- /dev/null +++ b/engine/src/flutter/common/exported_test_symbols.sym @@ -0,0 +1,13 @@ +# These symbols are looked up from within the executable at runtime and must +# be exported in the dynamic symbol table. +{ + kDartVmSnapshotData; + kDartVmSnapshotInstructions; + kDartIsolateSnapshotData; + kDartIsolateSnapshotInstructions; + InternalFlutterGpu*; + kInternalFlutterGpu*; + Spawn; + LoadLibraryFromKernel; + LookupEntryPoint; +}; diff --git a/engine/src/flutter/common/exported_test_symbols_mac.sym b/engine/src/flutter/common/exported_test_symbols_mac.sym new file mode 100644 index 0000000000..fe05d5602a --- /dev/null +++ b/engine/src/flutter/common/exported_test_symbols_mac.sym @@ -0,0 +1,11 @@ +# These symbols are looked up from within the executable at runtime and must +# be exported in the dynamic symbol table. +_kDartVmSnapshotData +_kDartVmSnapshotInstructions +_kDartIsolateSnapshotData +_kDartIsolateSnapshotInstructions +_InternalFlutterGpu* +_kInternalFlutterGpu* +_Spawn +_LoadLibraryFromKernel +_LookupEntryPoint diff --git a/engine/src/flutter/runtime/dart_isolate.cc b/engine/src/flutter/runtime/dart_isolate.cc index 6bde83da97..9c7c8a0530 100644 --- a/engine/src/flutter/runtime/dart_isolate.cc +++ b/engine/src/flutter/runtime/dart_isolate.cc @@ -522,8 +522,8 @@ bool DartIsolate::LoadKernel(const std::shared_ptr& mapping, return false; } - // Mapping must be retained until isolate shutdown. - kernel_buffers_.push_back(mapping); + // Mapping must be retained until isolate group shutdown. + GetIsolateGroupData().AddKernelBuffer(mapping); Dart_Handle library = Dart_LoadLibraryFromKernel(mapping->GetMapping(), mapping->GetSize()); @@ -589,7 +589,8 @@ bool DartIsolate::LoadKernel(const std::shared_ptr& mapping, // executed leads to crashes. if (GetIsolateGroupData().GetChildIsolatePreparer() == nullptr) { GetIsolateGroupData().SetChildIsolatePreparer( - [buffers = kernel_buffers_](DartIsolate* isolate) { + [buffers = + GetIsolateGroupData().GetKernelBuffers()](DartIsolate* isolate) { for (uint64_t i = 0; i < buffers.size(); i++) { bool last_piece = i + 1 == buffers.size(); const std::shared_ptr& buffer = buffers.at(i); @@ -1130,6 +1131,30 @@ Dart_Handle DartIsolate::OnDartLoadLibrary(intptr_t loading_unit_id) { return Dart_NewApiError(error_message.c_str()); } +Dart_Handle DartIsolate::LoadLibraryFromKernel( + const std::shared_ptr& mapping) { + if (DartVM::IsRunningPrecompiledCode()) { + return Dart_Null(); + } + + auto* isolate_group_data = + static_cast*>( + Dart_CurrentIsolateGroupData()); + // Mapping must be retained until isolate shutdown. + (*isolate_group_data)->AddKernelBuffer(mapping); + + auto lib = + Dart_LoadLibraryFromKernel(mapping->GetMapping(), mapping->GetSize()); + if (tonic::CheckAndHandleError(lib)) { + return Dart_Null(); + } + auto result = Dart_FinalizeLoading(false); + if (Dart_IsError(result)) { + return result; + } + return Dart_GetField(lib, Dart_NewStringFromCString("main")); +} + DartIsolate::AutoFireClosure::AutoFireClosure(const fml::closure& closure) : closure_(closure) {} diff --git a/engine/src/flutter/runtime/dart_isolate.h b/engine/src/flutter/runtime/dart_isolate.h index 0b0721f88c..58ae916c48 100644 --- a/engine/src/flutter/runtime/dart_isolate.h +++ b/engine/src/flutter/runtime/dart_isolate.h @@ -392,6 +392,11 @@ class DartIsolate : public UIDartState { const DartIsolateGroupData& GetIsolateGroupData() const; + /// Returns the "main" entrypoint of the library contained in the kernel + /// data in `mapping`. + static Dart_Handle LoadLibraryFromKernel( + const std::shared_ptr& mapping); + private: friend class IsolateConfiguration; class AutoFireClosure { @@ -407,7 +412,6 @@ class DartIsolate : public UIDartState { friend class DartVM; Phase phase_ = Phase::Unknown; - std::vector> kernel_buffers_; std::vector> shutdown_callbacks_; std::unordered_set> loading_unit_snapshots_; fml::RefPtr message_handling_task_runner_; diff --git a/engine/src/flutter/runtime/dart_isolate_group_data.cc b/engine/src/flutter/runtime/dart_isolate_group_data.cc index 131f887715..8c1c09b257 100644 --- a/engine/src/flutter/runtime/dart_isolate_group_data.cc +++ b/engine/src/flutter/runtime/dart_isolate_group_data.cc @@ -83,4 +83,14 @@ DartIsolateGroupData::GetPlatformMessageHandler( : it->second; } +void DartIsolateGroupData::AddKernelBuffer( + const std::shared_ptr& buffer) { + kernel_buffers_.push_back(buffer); +} + +std::vector> +DartIsolateGroupData::GetKernelBuffers() const { + return kernel_buffers_; +} + } // namespace flutter diff --git a/engine/src/flutter/runtime/dart_isolate_group_data.h b/engine/src/flutter/runtime/dart_isolate_group_data.h index 8faef1abf8..8b862564d2 100644 --- a/engine/src/flutter/runtime/dart_isolate_group_data.h +++ b/engine/src/flutter/runtime/dart_isolate_group_data.h @@ -56,6 +56,13 @@ class DartIsolateGroupData : public PlatformMessageHandlerStorage { void SetChildIsolatePreparer(const ChildIsolatePreparer& value); + /// Adds a kernel buffer mapping to the kernels loaded for this isolate group. + void AddKernelBuffer(const std::shared_ptr& buffer); + + /// A copy of the mappings for all kernel buffer objects loaded into this + /// isolate group. + std::vector> GetKernelBuffers() const; + // |PlatformMessageHandlerStorage| void SetPlatformMessageHandler( int64_t root_isolate_token, @@ -66,6 +73,7 @@ class DartIsolateGroupData : public PlatformMessageHandlerStorage { int64_t root_isolate_token) const override; private: + std::vector> kernel_buffers_; const Settings settings_; const fml::RefPtr isolate_snapshot_; const std::string advisory_script_uri_; diff --git a/engine/src/flutter/shell/common/run_configuration.cc b/engine/src/flutter/shell/common/run_configuration.cc index 964d5d6c15..5ab909e021 100644 --- a/engine/src/flutter/shell/common/run_configuration.cc +++ b/engine/src/flutter/shell/common/run_configuration.cc @@ -12,12 +12,14 @@ #include "flutter/fml/file.h" #include "flutter/fml/unique_fd.h" #include "flutter/runtime/dart_vm.h" +#include "runtime/isolate_configuration.h" namespace flutter { RunConfiguration RunConfiguration::InferFromSettings( const Settings& settings, - const fml::RefPtr& io_worker) { + const fml::RefPtr& io_worker, + IsolateLaunchType launch_type) { auto asset_manager = std::make_shared(); if (fml::UniqueFD::traits_type::IsValid(settings.assets_dir)) { @@ -31,7 +33,7 @@ RunConfiguration RunConfiguration::InferFromSettings( true)); return {IsolateConfiguration::InferFromSettings(settings, asset_manager, - io_worker), + io_worker, launch_type), asset_manager}; } diff --git a/engine/src/flutter/shell/common/run_configuration.h b/engine/src/flutter/shell/common/run_configuration.h index 57b6d784f0..2c327b7af0 100644 --- a/engine/src/flutter/shell/common/run_configuration.h +++ b/engine/src/flutter/shell/common/run_configuration.h @@ -51,13 +51,16 @@ class RunConfiguration { /// serial worker is kept alive for the lifetime of the /// shell associated with the engine that this run /// configuration is given to. + /// @param[in] launch_type Whether to launch the new isolate into an existing + /// group or a new one. /// /// @return A run configuration. Depending on the completeness of the /// settings, This object may potentially be invalid. /// static RunConfiguration InferFromSettings( const Settings& settings, - const fml::RefPtr& io_worker = nullptr); + const fml::RefPtr& io_worker = nullptr, + IsolateLaunchType launch_type = IsolateLaunchType::kNewGroup); //---------------------------------------------------------------------------- /// @brief Creates a run configuration with only an isolate diff --git a/engine/src/flutter/shell/testing/BUILD.gn b/engine/src/flutter/shell/testing/BUILD.gn index 32d647445b..7685d3a80e 100644 --- a/engine/src/flutter/shell/testing/BUILD.gn +++ b/engine/src/flutter/shell/testing/BUILD.gn @@ -18,7 +18,7 @@ executable("testing") { public_configs = [ "//flutter:config", - "//flutter:export_dynamic_symbols", + "//flutter:export_dynamic_test_symbols", ] sources = [ "tester_main.cc" ] @@ -42,6 +42,7 @@ executable("testing") { "//flutter/shell/gpu:gpu_surface_software", "//flutter/skia", "//flutter/third_party/tonic", + "//third_party/abseil-cpp/absl/base:no_destructor", "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:dart_io_api", ] diff --git a/engine/src/flutter/shell/testing/tester_main.cc b/engine/src/flutter/shell/testing/tester_main.cc index b2696be659..2f0992ebbc 100644 --- a/engine/src/flutter/shell/testing/tester_main.cc +++ b/engine/src/flutter/shell/testing/tester_main.cc @@ -25,6 +25,7 @@ #include "flutter/shell/common/thread_host.h" #include "flutter/shell/gpu/gpu_surface_software.h" +#include "third_party/abseil-cpp/absl/base/no_destructor.h" #include "third_party/dart/runtime/include/bin/dart_io_api.h" #include "third_party/dart/runtime/include/dart_api.h" #include "third_party/skia/include/core/SkSurface.h" @@ -131,8 +132,28 @@ struct ImpellerVulkanContextHolder {}; namespace flutter { +static absl::NoDestructor> g_shell; + static constexpr int64_t kImplicitViewId = 0ll; +static void ConfigureShell(Shell* shell) { + auto device_pixel_ratio = 3.0; + auto physical_width = 2400.0; // 800 at 3x resolution. + auto physical_height = 1800.0; // 600 at 3x resolution. + + std::vector> displays; + displays.push_back(std::make_unique( + 0, 60, physical_width, physical_height, device_pixel_ratio)); + shell->OnDisplayUpdates(std::move(displays)); + + flutter::ViewportMetrics metrics{}; + metrics.device_pixel_ratio = device_pixel_ratio; + metrics.physical_width = physical_width; + metrics.physical_height = physical_height; + metrics.display_id = 0; + shell->GetPlatformView()->SetViewportMetrics(kImplicitViewId, metrics); +} + class TesterExternalViewEmbedder : public ExternalViewEmbedder { // |ExternalViewEmbedder| DlCanvas* GetRootCanvas() override { return nullptr; } @@ -384,12 +405,14 @@ int RunTester(const flutter::Settings& settings, shell, Rasterizer::MakeGpuImageBehavior::kBitmap); }; - auto shell = Shell::Create(flutter::PlatformData(), // - task_runners, // - settings, // - on_create_platform_view, // - on_create_rasterizer // - ); + g_shell->reset(Shell::Create(flutter::PlatformData(), // + task_runners, // + settings, // + on_create_platform_view, // + on_create_rasterizer // + ) + .release()); + auto shell = g_shell->get(); if (!shell || !shell->IsSetup()) { FML_LOG(ERROR) << "Could not set up the shell."; @@ -479,21 +502,7 @@ int RunTester(const flutter::Settings& settings, } }); - auto device_pixel_ratio = 3.0; - auto physical_width = 2400.0; // 800 at 3x resolution. - auto physical_height = 1800.0; // 600 at 3x resolution. - - std::vector> displays; - displays.push_back(std::make_unique( - 0, 60, physical_width, physical_height, device_pixel_ratio)); - shell->OnDisplayUpdates(std::move(displays)); - - flutter::ViewportMetrics metrics{}; - metrics.device_pixel_ratio = device_pixel_ratio; - metrics.physical_width = physical_width; - metrics.physical_height = physical_height; - metrics.display_id = 0; - shell->GetPlatformView()->SetViewportMetrics(kImplicitViewId, metrics); + ConfigureShell(shell); // Run the message loop and wait for the script to do its thing. fml::MessageLoop::GetCurrent().Run(); @@ -503,6 +512,8 @@ int RunTester(const flutter::Settings& settings, fml::TaskRunner::RunNowOrPostTask(ui_task_runner, task_observer_remove); latch.Wait(); + delete g_shell->release(); + if (!engine_did_run) { // If the engine itself didn't have a chance to run, there is no point in // asking it if there was an error. Signal a failure unconditionally. @@ -512,6 +523,94 @@ int RunTester(const flutter::Settings& settings, return completion_observer.GetExitCodeForLastError(); } +#ifdef _WIN32 +#define EXPORTED __declspec(dllexport) +#else +#define EXPORTED __attribute__((visibility("default"))) +#endif + +extern "C" { +EXPORTED Dart_Handle LoadLibraryFromKernel(const char* path) { + std::shared_ptr mapping = + fml::FileMapping::CreateReadOnly(path); + if (!mapping) { + return Dart_Null(); + } + return DartIsolate::LoadLibraryFromKernel(mapping); +} + +EXPORTED Dart_Handle LookupEntryPoint(const char* uri, const char* name) { + if (!uri || !name) { + return Dart_Null(); + } + Dart_Handle lib = Dart_LookupLibrary(Dart_NewStringFromCString(uri)); + if (Dart_IsError(lib)) { + return lib; + } + return Dart_GetField(lib, Dart_NewStringFromCString(name)); +} + +EXPORTED void Spawn(const char* entrypoint, const char* route) { + auto shell = g_shell->get(); + auto isolate = Dart_CurrentIsolate(); + auto spawn_task = [shell, entrypoint = std::string(entrypoint), + route = std::string(route)]() { + auto configuration = RunConfiguration::InferFromSettings( + shell->GetSettings(), /*io_worker=*/nullptr, + /*launch_type=*/IsolateLaunchType::kExistingGroup); + configuration.SetEntrypoint(entrypoint); + + Shell::CreateCallback on_create_platform_view = + fml::MakeCopyable([](Shell& shell) mutable { + ImpellerVulkanContextHolder impeller_context_holder; + return std::make_unique( + shell, shell.GetTaskRunners(), + std::move(impeller_context_holder)); + }); + + Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { + return std::make_unique( + shell, Rasterizer::MakeGpuImageBehavior::kBitmap); + }; + + // Spawn a shell, and keep it running until it has no live ports, then + // delete it on the platform thread. + auto spawned_shell = + shell + ->Spawn(std::move(configuration), route, on_create_platform_view, + on_create_rasterizer) + .release(); + + ConfigureShell(spawned_shell); + + fml::TaskRunner::RunNowOrPostTask( + spawned_shell->GetTaskRunners().GetUITaskRunner(), [spawned_shell]() { + fml::MessageLoop::GetCurrent().AddTaskObserver( + reinterpret_cast(spawned_shell), [spawned_shell]() { + if (spawned_shell->EngineHasLivePorts()) { + return; + } + + fml::MessageLoop::GetCurrent().RemoveTaskObserver( + reinterpret_cast(spawned_shell)); + // Shell must be deleted on the platform task runner. + fml::TaskRunner::RunNowOrPostTask( + spawned_shell->GetTaskRunners().GetPlatformTaskRunner(), + [spawned_shell]() { delete spawned_shell; }); + }); + }); + }; + Dart_ExitIsolate(); + // The global shell pointer is never deleted, short of application exit. + // This UI task runner cannot be latched because it will block spawning a new + // shell in the case where flutter_tester is running multithreaded. + fml::TaskRunner::RunNowOrPostTask( + shell->GetTaskRunners().GetPlatformTaskRunner(), spawn_task); + + Dart_EnterIsolate(isolate); +} +} + } // namespace flutter int main(int argc, char* argv[]) { diff --git a/engine/src/flutter/testing/dart/BUILD.gn b/engine/src/flutter/testing/dart/BUILD.gn index da9c0fc2a4..3cef3ae628 100644 --- a/engine/src/flutter/testing/dart/BUILD.gn +++ b/engine/src/flutter/testing/dart/BUILD.gn @@ -43,6 +43,8 @@ tests = [ "plugin_utilities_test.dart", "semantics_test.dart", "serial_gc_test.dart", + "spawn_helper.dart", + "spawn_test.dart", "task_order_test.dart", "text_test.dart", "window_test.dart", @@ -50,11 +52,13 @@ tests = [ foreach(test, tests) { flutter_build_dir = rebase_path("$root_gen_dir") + flutter_src_dir = rebase_path("$root_out_dir/../../flutter") skia_gold_work_dir = rebase_path("$root_gen_dir/skia_gold_$test") flutter_frontend_server("compile_$test") { main_dart = test kernel_output = "$root_gen_dir/$test.dill" extra_args = [ + "-DkFlutterSrcDirectory=$flutter_src_dir", "-DkFlutterBuildDirectory=$flutter_build_dir", "-DkSkiaGoldWorkDirectory=$skia_gold_work_dir", ] diff --git a/engine/src/flutter/testing/dart/pubspec.yaml b/engine/src/flutter/testing/dart/pubspec.yaml index 078a449e1d..3b7d70655c 100644 --- a/engine/src/flutter/testing/dart/pubspec.yaml +++ b/engine/src/flutter/testing/dart/pubspec.yaml @@ -17,6 +17,7 @@ environment: sdk: '>=3.2.0-0 <4.0.0' dependencies: + ffi: any litetest: any path: any skia_gold_client: any @@ -38,6 +39,8 @@ dependency_overrides: path: ../../../third_party/dart/pkg/expect file: path: ../../../third_party/dart/third_party/pkg/file/packages/file + ffi: + path: ../../../third_party/dart/third_party/pkg/ffi fixnum: path: ../../../third_party/dart/third_party/pkg/fixnum litetest: diff --git a/engine/src/flutter/testing/dart/spawn_helper.dart b/engine/src/flutter/testing/dart/spawn_helper.dart new file mode 100644 index 0000000000..31d1acefd6 --- /dev/null +++ b/engine/src/flutter/testing/dart/spawn_helper.dart @@ -0,0 +1,10 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +void main() {} + +@pragma('vm:entry-point') +int echoInt(int echo) { + return echo; +} diff --git a/engine/src/flutter/testing/dart/spawn_test.dart b/engine/src/flutter/testing/dart/spawn_test.dart new file mode 100644 index 0000000000..a3f87b2a97 --- /dev/null +++ b/engine/src/flutter/testing/dart/spawn_test.dart @@ -0,0 +1,87 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:ffi'; +import 'dart:isolate'; +import 'dart:ui'; + +import 'package:ffi/ffi.dart'; +import 'package:litetest/litetest.dart'; + +// This import is used in a test, but not in a way that the analyzer can understand. +// ignore: unused_import +import 'spawn_helper.dart'; + +@Native)>(symbol: 'LoadLibraryFromKernel') +external Object _loadLibraryFromKernel(Pointer path); + +@Native, Pointer)>(symbol: 'LookupEntryPoint') +external Object _lookupEntryPoint(Pointer library, Pointer name); + +@Native, Pointer)>(symbol: 'Spawn') +external void _spawn(Pointer entrypoint, Pointer route); + +void spawn({ + required SendPort port, + String entrypoint = 'main', + String route = '/', +}) { + assert( + entrypoint != 'main' || route != '/', + 'Spawn should not be used to spawn main with the default route name', + ); + IsolateNameServer.registerPortWithName(port, route); + final Pointer nativeEntrypoint = entrypoint.toNativeUtf8(); + final Pointer nativeRoute = route.toNativeUtf8(); + _spawn(nativeEntrypoint, nativeRoute); + malloc.free(nativeEntrypoint); + malloc.free(nativeRoute); +} + +const String kTestEntrypointRouteName = 'testEntrypoint'; + +@pragma('vm:entry-point') +void testEntrypoint() { + expect(PlatformDispatcher.instance.defaultRouteName, kTestEntrypointRouteName); + IsolateNameServer.lookupPortByName(kTestEntrypointRouteName)!.send(null); +} + +void main() { + const bool kReleaseMode = bool.fromEnvironment('dart.vm.product'); + const bool kProfileMode = bool.fromEnvironment('dart.vm.profile'); + + test('Spawn a different entrypoint with a special route name', () async { + final ReceivePort port = ReceivePort(); + spawn(port: port.sendPort, entrypoint: 'testEntrypoint', route: kTestEntrypointRouteName); + expect(await port.first, isNull); + port.close(); + }); + + test('Lookup entrypoint and execute', () { + final Pointer libraryPath = 'file://${const String.fromEnvironment('kFlutterSrcDirectory')}/testing/dart/spawn_helper.dart'.toNativeUtf8(); + final Pointer entryPoint = 'echoInt'.toNativeUtf8(); + expect( + (_lookupEntryPoint( + libraryPath, + entryPoint, + ) as int Function(int))(42), + 42, + ); + malloc.free(libraryPath); + malloc.free(entryPoint); + }); + + test('Load from kernel', () { + final Pointer kernelPath = '${const String.fromEnvironment('kFlutterBuildDirectory')}/spawn_helper.dart.dill'.toNativeUtf8(); + expect( + _loadLibraryFromKernel(kernelPath) is void Function(), + true, + ); + malloc.free(kernelPath); + + final Pointer fakePath = 'fake-path'.toNativeUtf8(); + expect(_loadLibraryFromKernel(fakePath), null); + malloc.free(fakePath); + }, skip: kProfileMode || kReleaseMode); // ignore: avoid_redundant_argument_values +} diff --git a/engine/src/flutter/testing/run_tests.py b/engine/src/flutter/testing/run_tests.py index ab87ddf660..c2d4d1fbe3 100755 --- a/engine/src/flutter/testing/run_tests.py +++ b/engine/src/flutter/testing/run_tests.py @@ -1058,7 +1058,7 @@ def run_engine_tasks_in_parallel(tasks): if len(failures) > 0: logger.error('The following commands failed:') for task, exn in failures: - logger.error('%s\n', str(task)) + logger.error('%s\n %s\n\n', str(task), str(exn)) return False return True