Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4), antivirus related #44509

Open
jmagman opened this issue Dec 17, 2020 · 22 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@jmagman
Copy link

jmagman commented Dec 17, 2020

Reported by @haamaanaa at flutter/flutter#70940

Steps to Reproduce

  1. upgraded to MacOS Big Sur:
    System Version: macOS 11.0.1 (20B29)
    Kernel Version: Darwin 20.1.0
  2. running any unit test that flutter project already had before updating laptop OS version

did try to clean flutter pub cache with flutter pub cache repair, and also by deleting said cache folder from laptop and then running flutter pub get again on project and running tests.... still failed

Expected results:

unit test to run successfully at all times
(In Catalina OS version, same test(s) run without fail)

Actual results:

at random runs the test fails

Verbose Log

[  +28 ms] test 0: awaiting initial result for pid 20741
00:04 +0: loading /Users/me/dev-env/app/packages/collector/test/collector_test.dart                [ +810 ms] test 0: process with pid 20741 connected to test harness
[   +1 ms] test 0: awaiting test result for pid 20741
00:04 +0 -1: loading /Users/me/dev-env/app/packages/collector/test/collector_test.dart [E]         
  Failed to load "/Users/me/dev-env/app/packages/collector/test/collector_test.dart": Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4)
  dart:io-patch/directory_patch.dart 64:5                                                                                 _uriBaseClosure
  dart:core-patch/uri_patch.dart 21:41                                                                                    Uri.base
  package:path/src/style.dart 42:14                                                                                       Style._getPlatformStyle
  package:path/src/style.dart 33:33                                                                                       Style.platform
  package:path/src/style.dart                                                                                             Style.platform
  package:flutter_test/src/_goldens_io.dart 71:52                                                                         LocalFileComparator._getPath
  package:flutter_test/src/_goldens_io.dart 75:34                                                                         LocalFileComparator._getBasedir
  package:flutter_test/src/_goldens_io.dart 67:17                                                                         new LocalFileComparator
  /var/folders/rz/dt7c_sjs3hv2hk3pxz9qf2f80000gn/T/flutter_tools.xUGs3h/flutter_test_listener.9FVTCU/listener.dart 42:24  main.<fn>
  package:test_api/src/remote_listener.dart 68:27                                                                         RemoteListener.start.<fn>.<fn>.<fn>
  package:test_api/src/remote_listener.dart 65:25                                                                         RemoteListener.start.<fn>.<fn>.<fn>
  dart:async/zone.dart 1186:13                                                                                            _rootRun
  dart:async/zone.dart 1090:19                                                                                            _CustomZone.run
  dart:async/zone.dart 1626:10                                                                                            _runZoned
  dart:async/zone.dart 1614:12                                                                                            runZonedGuarded
  package:test_api/src/remote_listener.dart 65:9                                                                          RemoteListener.start.<fn>.<fn>
  dart:async/zone.dart 1186:13                                                                                            _rootRun
  dart:async/zone.dart 1090:19                                                                                            _CustomZone.run
  dart:async/zone.dart 1626:10                                                                                            _runZoned
  dart:async/zone.dart 1546:10                                                                                            runZoned
  package:test_api/src/backend/stack_trace_formatter.dart 42:7                                                            StackTraceFormatter.asCurrent
  package:test_api/src/remote_listener.dart 64:29                                                                         RemoteListener.start.<fn>
  dart:async/zone.dart 1186:13                                                                                            _rootRun
  dart:async/zone.dart 1090:19                                                                                            _CustomZone.run
  dart:async/zone.dart 1626:10                                                                                            _runZoned
  dart:async/zone.dart 1546:10                                                                                            runZoned
  package:test_api/src/suite_channel_manager.dart 35:7                                                                    SuiteChannelManager.asCurrent
  package:test_api/src/remote_listener.dart 63:27                                                                         RemoteListener.start
  /var/folders/rz/dt7c_sjs3hv2hk3pxz9qf2f80000gn/T/flutter_tools.xUGs3h/flutter_test_listener.9FVTCU/listener.dart 15:25  serializeSuite
  /var/folders/rz/dt7c_sjs3hv2hk3pxz9qf2f80000gn/T/flutter_tools.xUGs3h/flutter_test_listener.9FVTCU/listener.dart 40:36  main
  dart:ui/hooks.dart 136:25                                                                                               _runMainZoned.<fn>.<fn>
  dart:async/zone.dart 1186:13                                                                                            _rootRun
  dart:async/zone.dart 1090:19                                                                                            _CustomZone.run
  dart:async/zone.dart 1626:10                                                                                            _runZoned
  dart:async/zone.dart 1614:12                                                                                            runZonedGuarded
  dart:ui/hooks.dart 132:5                                                                                                _runMainZoned.<fn>
  dart:isolate-patch/isolate_patch.dart 283:19                                                                            _delayEntrypointInvocation.<fn>
  dart:isolate-patch/isolate_patch.dart 184:12                                                                            _RawReceivePortImpl._handleMessage
 Run `flutter analyze`

no issues

  Run `flutter doctor -v`

[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B29 darwin-x64, locale en-FI)
• Flutter version 1.22.4 at /Users/me/dev-env/flutter
• Framework revision 1aafb3a8b9 (7 days ago), 2020-11-13 09:59:28 -0800
• Engine revision 2c956a31c0
• Dart version 2.10.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/me/Library/Android/sdk
• Platform android-30, build-tools 29.0.2
• ANDROID_HOME = /Users/me/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.2, Build version 12B45b
• CocoaPods version 1.8.4

[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.51.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.16.0

[!] Connected device
! No devices available

! Doctor found issues in 1 category.

@jmagman
Copy link
Author

jmagman commented Dec 17, 2020

A few users reporting this in flutter/flutter#70940 on Big Sur.

@jmagman
Copy link
Author

jmagman commented Dec 17, 2020

@haamaanaa @MoustafaMesbah @thisdarktao @sgorbyo @remonh87
Do you see any suspicious logs in Console when you reproduce that could give a hint as to what's interrupting the call? Maybe from syspolicyd or kernel?

@sgorbyo
Copy link

sgorbyo commented Dec 18, 2020

@jmagman
Running a test battery (running tests from a parent directory) the resulting log contains some additional info on shell stack. Really don't expect them to be useful. I've never seen anything more than that.

Testing started at 11:58 AM ...
/Users/danilo/DevEnvironments/flutter/bin/flutter --no-color test --machine test
dart:core Uri.base
package:path/path.dart 73:15 current
package:path/src/context.dart 62:39 Context.current
package:path/src/context.dart 471:27 Context.relative
package:path/src/context.dart 1062:17 Context.prettyUri
package:path/path.dart 461:34 prettyUri
===== asynchronous gap ===========================
package:test_api RemoteListener.start
/var/folders/8w/l56h825n7rj73d6nyts8712w0000gn/T/flutter_tools.OTjbwB/flutter_test_listener.x0HEsd/listener.dart 16:25 serializeSuite
/var/folders/8w/l56h825n7rj73d6nyts8712w0000gn/T/flutter_tools.OTjbwB/flutter_test_listener.x0HEsd/listener.dart 41:36 main

Failed to load "/Users/danilo/AndroidStudioProjects/flutter_genogram/test/geometric_tools_test.dart": Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4)

Shell: [ERROR:flutter/shell/testing/tester_main.cc(302)] Unhandled exception
Shell: Exception: FileSystemException: Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4)
Shell: Stack trace: #0 _uriBaseClosure (dart:io-patch/directory_patch.dart:64:5)
Shell: #1 Uri.base (dart:core-patch/uri_patch.dart:21:41)
Shell: #2 Style._getPlatformStyle (package:path/src/style.dart:41:13)
Shell: #3 Style.platform (package:path/src/style.dart:33:33)
Shell: #4 Style.platform (package:path/src/style.dart)
Shell: #5 new Context._internal (package:path/src/context.dart:49:23)
Shell: #6 createInternal (package:path/src/context.dart:14:37)
Shell: #7 context (package:path/path.dart:56:25)
Shell: #8 context (package:path/path.dart)
Shell: #9 prettyUri (package:path/path.dart:461:26)
Shell: #10 Frame.library (package:stack_trace/src/frame.dart:105:12)
Shell: #11 Frame.location (package:stack_trace/src/frame.dart:119:14)
Shell: #12 Chain.toString.. (package:stack_trace/src/chain.dart:256:33)
Shell: #13 MappedListIterable.elementAt (dart:_internal/iterable.dart:417:31)
Shell: #14 ListIterable.fold (dart:_internal/iterable.dart:195:30)
Shell: #15 Chain.toString. (package:stack_trace/src/chain.dart:257:12)
Shell: #16 MappedListIterable.elementAt (dart:_internal/iterable.dart:417:31)
Shell: #17 ListIterable.fold (dart:_internal/iterable.dart:195:30)
Shell: #18 Chain.toString (package:stack_trace/src/chain.dart:258:8)
Shell: #19 LazyChain.toString (package:stack_trace/src/lazy_chain.dart:32:31)
Shell: #20 RemoteException.serialize (package:test_api/src/util/remote_exception.dart:51:48)
Shell: #21 RemoteListener._sendError (package:test_api/src/remote_listener.dart:158:32)
Shell: #22 RemoteListener.start... (package:test_api/src/remote_listener.dart:130:11)
Shell: #23 _rootRunBinary (dart:async/zone.dart:1222:13)
Shell: #24 _CustomZone.runBinary (dart:async/zone.dart:1107:19)
Shell: #25 runZonedGuarded. (dart:async/zone.dart:1601:18)
Shell: #26 _CustomZone.handleUncaughtError (dart:async/zone.dart:1076:19)
Shell: #27 Future._propagateToListeners (dart:async/future_impl.dart:610:16)
Shell: #28 Future._completeError (dart:async/future_impl.dart:537:5)
Shell: #29 Future._asyncCompleteError. (dart:async/future_impl.dart:593:7)
Shell: #30 _rootRun (dart:async/zone.dart:1190:13)
Shell: #31 _CustomZone.run (dart:async/zone.dart:1093:19)
Shell: #32 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
Shell: #33 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)
Shell: #34 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
Shell: #35 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
Shell:
dart:async/stream_controller.dart 634:44 _StreamController.addError
dart:async/stream_controller.dart 904:13 _StreamSinkWrapper.addError
package:stream_channel/src/guarantee_channel.dart 145:14 _GuaranteeSink._addError
package:stream_channel/src/guarantee_channel.dart 136:5 _GuaranteeSink.addError
package:flutter_tools/src/test/flutter_platform.dart 546:27 FlutterPlatform._startTest
===== asynchronous gap ===========================
dart:async/zone.dart 1121:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 83:23 _asyncThenWrapperHelper
package:flutter_tools/src/test/flutter_platform.dart 349:36 FlutterPlatform.loadChannel
package:flutter_tools/src/test/flutter_platform.dart 302:46 FlutterPlatform.load
package:test_core/src/runner/loader.dart 224:38 Loader.loadFile.
===== asynchronous gap ===========================
dart:async/zone.dart 1121:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 83:23 _asyncThenWrapperHelper
package:test_core/src/runner/loader.dart Loader.loadFile.
package:test_core/src/runner/load_suite.dart 97:31 new LoadSuite..
package:test_core/src/runner/load_suite.dart 107:8 new LoadSuite.
package:test_api/src/backend/invoker.dart 231:15 Invoker.waitForOutstandingCallbacks.
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/backend/invoker.dart 228:5 Invoker.waitForOutstandingCallbacks
package:test_api/src/backend/invoker.dart 383:17 Invoker._onRun...
===== asynchronous gap ===========================
dart:async/zone.dart 1121:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 83:23 _asyncThenWrapperHelper
package:test_api/src/backend/invoker.dart Invoker._onRun...
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/backend/invoker.dart 370:9 Invoker._onRun..
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/backend/invoker.dart 150:7 Invoker.guard
package:test_api/src/backend/invoker.dart 413:15 Invoker._guardIfGuarded
package:test_api/src/backend/invoker.dart 369:7 Invoker._onRun.
package:stack_trace/src/chain.dart 104:24 Chain.capture.
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:stack_trace/src/chain.dart 102:12 Chain.capture
package:test_api/src/backend/invoker.dart 368:11 Invoker._onRun
package:test_api/src/backend/live_test_controller.dart 153:11 LiveTestController.run
dart:async/future.dart 201:37 new Future.microtask.
dart:async/zone.dart 1182:47 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 997:7 _CustomZone.runGuarded
dart:async/zone.dart 1037:23 _CustomZone.bindCallbackGuarded.
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 997:7 _CustomZone.runGuarded
dart:async/zone.dart 1037:23 _CustomZone.bindCallbackGuarded.
dart:async/schedule_microtask.dart 41:21 _microtaskLoop
dart:async/schedule_microtask.dart 50:5 _startMicrotaskLoop
dart:isolate-patch/isolate_patch.dart 118:13 _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 169:5 _RawReceivePortImpl._handleMessage

Failed to load "/Users/danilo/AndroidStudioProjects/flutter_genogram/test/features/access_management/domain/entities/crypto_key_setup_data_test.dart":
Shell subprocess cleanly reported an error before connecting to test harness. Check the logs above for an error message.
Test: /Users/danilo/AndroidStudioProjects/flutter_genogram/test/features/access_management/domain/entities/crypto_key_setup_data_test.dart
Shell: /Users/danilo/DevEnvironments/flutter/bin/cache/artifacts/engine/darwin-x64/flutter_tester

Shell: [ERROR:flutter/shell/testing/tester_main.cc(302)] Unhandled exception
Shell: Exception: FileSystemException: Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4)
Shell: Stack trace: #0 _uriBaseClosure (dart:io-patch/directory_patch.dart:64:5)
Shell: #1 Uri.base (dart:core-patch/uri_patch.dart:21:41)
Shell: #2 current (package:path/path.dart:73:15)
Shell: #3 Context.current (package:path/src/context.dart:62:39)
Shell: #4 Context.relative (package:path/src/context.dart:471:27)
Shell: #5 Context.prettyUri (package:path/src/context.dart:1062:17)
Shell: #6 prettyUri (package:path/path.dart:461:34)
Shell: #7 Frame.library (package:stack_trace/src/frame.dart:105:12)
Shell: #8 Frame.location (package:stack_trace/src/frame.dart:119:14)
Shell: #9 Chain.toString.. (package:stack_trace/src/chain.dart:256:33)
Shell: #10 MappedListIterable.elementAt (dart:_internal/iterable.dart:417:31)
Shell: #11 ListIterable.fold (dart:_internal/iterable.dart:195:30)
Shell: #12 Chain.toString. (package:stack_trace/src/chain.dart:257:12)
Shell: #13 MappedListIterable.elementAt (dart:_internal/iterable.dart:417:31)
Shell: #14 ListIterable.fold (dart:_internal/iterable.dart:195:30)
Shell: #15 Chain.toString (package:stack_trace/src/chain.dart:258:8)
Shell: #16 LazyChain.toString (package:stack_trace/src/lazy_chain.dart:32:31)
Shell: #17 RemoteException.serialize (package:test_api/src/util/remote_exception.dart:51:48)
Shell: #18 RemoteListener._sendError (package:test_api/src/remote_listener.dart:158:32)
Shell: #19 RemoteListener.start... (package:test_api/src/remote_listener.dart:130:11)
Shell: #20 _rootRunBinary (dart:async/zone.dart:1222:13)
Shell: #21 _CustomZone.runBinary (dart:async/zone.dart:1107:19)
Shell: #22 runZonedGuarded. (dart:async/zone.dart:1601:18)
Shell: #23 _CustomZone.handleUncaughtError (dart:async/zone.dart:1076:19)
Shell: #24 Future._propagateToListeners (dart:async/future_impl.dart:610:16)
Shell: #25 Future._completeError (dart:async/future_impl.dart:537:5)
Shell: #26 _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:47:15)
Shell: #27 RemoteListener.start... (package:test_api/src/remote_listener.dart)
Shell:
Shell: #28 RemoteListener.start... (package:test_api/src/remote_listener.dart)
Shell: #29 _rootRun (dart:async/zone.dart:1190:13)
Shell: #30 _CustomZone.run (dart:async/zone.dart:1093:19)
Shell: #31 _runZoned (dart:async/zone.dart:1630:10)
Shell: #32 runZonedGuarded (dart:async/zone.dart:1618:12)
Shell: #33 RemoteListener.start.. (package:test_api/src/remote_listener.dart:66:9)
Shell: #34 _rootRun (dart:async/zone.dart:1190:13)
Shell: #35 _CustomZone.run (dart:async/zone.dart:1093:19)
Shell: #36 _runZoned (dart:async/zone.dart:1630:10)
Shell: #37 runZoned (dart:async/zone.dart:1550:10)
Shell: #38 StackTraceFormatter.asCurrent (package:test_api/src/backend/stack_trace_formatter.dart:42:7)
Shell: #39 RemoteListener.start. (package:test_api/src/remote_listener.dart:65:29)
Shell: #40 _rootRun (dart:async/zone.dart:1190:13)
Shell: #41 _CustomZone.run (dart:async/zone.dart:1093:19)
Shell: #42 _runZoned (dart:async/zone.dart:1630:10)
Shell: #43 runZoned (dart:async/zone.dart:1550:10)
Shell: #44 SuiteChannelManager.asCurrent (package:test_api/src/suite_channel_manager.dart:35:7)
Shell: #45 RemoteListener.start (package:test_api/src/remote_listener.dart:64:27)
Shell: #46 serializeSuite (file:///var/folders/8w/l56h825n7rj73d6nyts8712w0000gn/T/flutter_tools.OTjbwB/flutter_test_listener.4W88Lr/listener.dart:16:25)
Shell: #47 main (file:///var/folders/8w/l56h825n7rj73d6nyts8712w0000gn/T/flutter_tools.OTjbwB/flutter_test_listener.4W88Lr/listener.dart:41:36)
Shell: #48 _runMainZoned.. (dart:ui/hooks.dart:231:25)
Shell: #49 _rootRun (dart:async/zone.dart:1190:13)
Shell: #50 _CustomZone.run (dart:async/zone.dart:1093:19)
Shell: #51 _runZoned (dart:async/zone.dart:1630:10)
Shell: #52 runZonedGuarded (dart:async/zone.dart:1618:12)
Shell: #53 _runMainZoned. (dart:ui/hooks.dart:223:5)
Shell: #54 _startIsolate. (dart:isolate-patch/isolate_patch.dart:301:19)
Shell: #55 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Shell:
dart:async/stream_controller.dart 634:44 _StreamController.addError
dart:async/stream_controller.dart 904:13 _StreamSinkWrapper.addError
package:stream_channel/src/guarantee_channel.dart 145:14 _GuaranteeSink._addError
package:stream_channel/src/guarantee_channel.dart 136:5 _GuaranteeSink.addError
package:flutter_tools/src/test/flutter_platform.dart 480:29 FlutterPlatform._startTest.
===== asynchronous gap ===========================
dart:async/zone.dart 1121:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 83:23 _asyncThenWrapperHelper
package:flutter_tools/src/test/flutter_platform.dart FlutterPlatform._startTest.
package:flutter_tools/src/test/flutter_platform.dart 658:26 FlutterPlatform._startTest
===== asynchronous gap ===========================
dart:async/zone.dart 1121:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 83:23 _asyncThenWrapperHelper
package:flutter_tools/src/test/flutter_platform.dart 349:36 FlutterPlatform.loadChannel
package:flutter_tools/src/test/flutter_platform.dart 302:46 FlutterPlatform.load
package:test_core/src/runner/loader.dart 224:38 Loader.loadFile.
===== asynchronous gap ===========================
dart:async/zone.dart 1121:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 83:23 _asyncThenWrapperHelper
package:test_core/src/runner/loader.dart Loader.loadFile.
package:test_core/src/runner/load_suite.dart 97:31 new LoadSuite..
package:test_core/src/runner/load_suite.dart 107:8 new LoadSuite.
package:test_api/src/backend/invoker.dart 231:15 Invoker.waitForOutstandingCallbacks.
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/backend/invoker.dart 228:5 Invoker.waitForOutstandingCallbacks
package:test_api/src/backend/invoker.dart 383:17 Invoker._onRun...
===== asynchronous gap ===========================
dart:async/zone.dart 1121:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 83:23 _asyncThenWrapperHelper
package:test_api/src/backend/invoker.dart Invoker._onRun...
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/backend/invoker.dart 370:9 Invoker._onRun..
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/backend/invoker.dart 150:7 Invoker.guard
package:test_api/src/backend/invoker.dart 413:15 Invoker._guardIfGuarded
package:test_api/src/backend/invoker.dart 369:7 Invoker._onRun.
package:stack_trace/src/chain.dart 104:24 Chain.capture.
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:stack_trace/src/chain.dart 102:12 Chain.capture
package:test_api/src/backend/invoker.dart 368:11 Invoker._onRun
package:test_api/src/backend/live_test_controller.dart 153:11 LiveTestController.run
dart:async/future.dart 201:37 new Future.microtask.
dart:async/zone.dart 1182:47 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 997:7 _CustomZone.runGuarded
dart:async/zone.dart 1037:23 _CustomZone.bindCallbackGuarded.
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 997:7 _CustomZone.runGuarded
dart:async/zone.dart 1037:23 _CustomZone.bindCallbackGuarded.
dart:async/schedule_microtask.dart 41:21 _microtaskLoop
dart:async/schedule_microtask.dart 50:5 _startMicrotaskLoop
dart:isolate-patch/isolate_patch.dart 118:13 _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 169:5 _RawReceivePortImpl._handleMessage

Failed to load "/Users/danilo/AndroidStudioProjects/flutter_genogram/test/features/access_management/domain/usecases/register_user_test.dart":
Shell subprocess cleanly reported an error after tests finished. Check the logs above for an error message.
Test: /Users/danilo/AndroidStudioProjects/flutter_genogram/test/features/access_management/domain/usecases/register_user_test.dart
Shell: /Users/danilo/DevEnvironments/flutter/bin/cache/artifacts/engine/darwin-x64/flutter_tester

Shell: [ERROR:flutter/shell/testing/tester_main.cc(302)] Unhandled exception
Shell: Exception: FileSystemException: Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4)
Shell: Stack trace: #0 _uriBaseClosure (dart:io-patch/directory_patch.dart:64:5)
Shell: #1 Uri.base (dart:core-patch/uri_patch.dart:21:41)
Shell: #2 current (package:path/path.dart:73:15)
Shell: #3 Context.current (package:path/src/context.dart:62:39)
Shell: #4 Context.relative (package:path/src/context.dart:471:27)
Shell: #5 Context.prettyUri (package:path/src/context.dart:1062:17)
Shell: #6 prettyUri (package:path/path.dart:461:34)
Shell: #7 Frame.library (package:stack_trace/src/frame.dart:105:12)
Shell: #8 Frame.location (package:stack_trace/src/frame.dart:119:14)
Shell: #9 Chain.toString.. (package:stack_trace/src/chain.dart:256:33)
Shell: #10 MappedListIterable.elementAt (dart:_internal/iterable.dart:417:31)
Shell: #11 ListIterable.fold (dart:_internal/iterable.dart:195:30)
Shell: #12 Chain.toString. (package:stack_trace/src/chain.dart:257:12)
Shell: #13 MappedListIterable.elementAt (dart:_internal/iterable.dart:417:31)
Shell: #14 ListIterable.fold (dart:_internal/iterable.dart:195:30)
Shell: #15 Chain.toString (package:stack_trace/src/chain.dart:258:8)
Shell: #16 LazyChain.toString (package:stack_trace/src/lazy_chain.dart:32:31)
Shell: #17 RemoteException.serialize (package:test_api/src/util/remote_exception.dart:51:48)
Shell: #18 RemoteListener._sendError (package:test_api/src/remote_listener.dart:158:32)
Shell: #19 RemoteListener.start... (package:test_api/src/remote_listener.dart:130:11)
Shell: #20 _rootRunBinary (dart:async/zone.dart:1222:13)
Shell: #21 _CustomZone.runBinary (dart:async/zone.dart:1107:19)
Shell: #22 runZonedGuarded. (dart:async/zone.dart:1601:18)
Shell: #23 _CustomZone.handleUncaughtError (dart:async/zone.dart:1076:19)
Shell: #24 Future._propagateToListeners (dart:async/future_impl.dart:610:16)
Shell: #25 Future._completeError (dart:async/future_impl.dart:537:5)
Shell: #26 Future._asyncCompleteError. (dart:async/future_impl.dart:593:7)
Shell: #27 _rootRun (dart:async/zone.dart:1190:13)
Shell: #28 _CustomZone.run (dart:async/zone.dart:1093:19)
Shell: #29 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
Shell: #30 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)
Shell: #31 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
Shell: #32 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
Shell:
dart:async/stream_controller.dart 634:44 _StreamController.addError
dart:async/stream_controller.dart 904:13 _StreamSinkWrapper.addError
package:stream_channel/src/guarantee_channel.dart 145:14 _GuaranteeSink._addError
package:stream_channel/src/guarantee_channel.dart 136:5 _GuaranteeSink.addError
package:flutter_tools/src/test/flutter_platform.dart 546:27 FlutterPlatform._startTest
===== asynchronous gap ===========================
dart:async/zone.dart 1121:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 83:23 _asyncThenWrapperHelper
package:flutter_tools/src/test/flutter_platform.dart 349:36 FlutterPlatform.loadChannel
package:flutter_tools/src/test/flutter_platform.dart 302:46 FlutterPlatform.load
package:test_core/src/runner/loader.dart 224:38 Loader.loadFile.
===== asynchronous gap ===========================
dart:async/zone.dart 1121:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 83:23 _asyncThenWrapperHelper
package:test_core/src/runner/loader.dart Loader.loadFile.
package:test_core/src/runner/load_suite.dart 97:31 new LoadSuite..
package:test_core/src/runner/load_suite.dart 107:8 new LoadSuite.
package:test_api/src/backend/invoker.dart 231:15 Invoker.waitForOutstandingCallbacks.
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/backend/invoker.dart 228:5 Invoker.waitForOutstandingCallbacks
package:test_api/src/backend/invoker.dart 383:17 Invoker._onRun...
===== asynchronous gap ===========================
dart:async/zone.dart 1121:19 _CustomZone.registerUnaryCallback
dart:async-patch/async_patch.dart 83:23 _asyncThenWrapperHelper
package:test_api/src/backend/invoker.dart Invoker._onRun...
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/backend/invoker.dart 370:9 Invoker._onRun..
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/backend/invoker.dart 150:7 Invoker.guard
package:test_api/src/backend/invoker.dart 413:15 Invoker._guardIfGuarded
package:test_api/src/backend/invoker.dart 369:7 Invoker._onRun.
package:stack_trace/src/chain.dart 104:24 Chain.capture.
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:stack_trace/src/chain.dart 102:12 Chain.capture
package:test_api/src/backend/invoker.dart 368:11 Invoker._onRun
package:test_api/src/backend/live_test_controller.dart 153:11 LiveTestController.run
dart:async/future.dart 201:37 new Future.microtask.
dart:async/zone.dart 1182:47 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 997:7 _CustomZone.runGuarded
dart:async/zone.dart 1037:23 _CustomZone.bindCallbackGuarded.
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 997:7 _CustomZone.runGuarded
dart:async/zone.dart 1037:23 _CustomZone.bindCallbackGuarded.
dart:async/schedule_microtask.dart 41:21 _microtaskLoop
dart:async/schedule_microtask.dart 50:5 _startMicrotaskLoop
dart:isolate-patch/isolate_patch.dart 118:13 _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 169:5 _RawReceivePortImpl._handleMessage

Failed to load "/Users/danilo/AndroidStudioProjects/flutter_genogram/test/features/access_management/domain/entities/crypto_key_test.dart":
Shell subprocess cleanly reported an error before connecting to test harness. Check the logs above for an error message.
Test: /Users/danilo/AndroidStudioProjects/flutter_genogram/test/features/access_management/domain/entities/crypto_key_test.dart
Shell: /Users/danilo/DevEnvironments/flutter/bin/cache/artifacts/engine/darwin-x64/flutter_tester

dart:io-patch/directory_patch.dart 64:5 _uriBaseClosure
dart:core-patch/uri_patch.dart 21:41 Uri.base
package:path/src/style.dart 41:13 Style._getPlatformStyle
package:path/src/style.dart 33:33 Style.platform
package:path/src/style.dart Style.platform
package:flutter_test/src/_goldens_io.dart 70:52 LocalFileComparator._getPath
package:flutter_test/src/_goldens_io.dart 74:34 LocalFileComparator._getBasedir
package:flutter_test/src/_goldens_io.dart 66:17 new LocalFileComparator
/var/folders/8w/l56h825n7rj73d6nyts8712w0000gn/T/flutter_tools.OTjbwB/flutter_test_listener.C7BD69/listener.dart 43:32 main.
package:test_api/src/remote_listener.dart 69:27 RemoteListener.start...
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1618:12 runZonedGuarded
package:test_api/src/remote_listener.dart 66:9 RemoteListener.start..
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/backend/stack_trace_formatter.dart 42:7 StackTraceFormatter.asCurrent
package:test_api/src/remote_listener.dart 65:29 RemoteListener.start.
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1550:10 runZoned
package:test_api/src/suite_channel_manager.dart 35:7 SuiteChannelManager.asCurrent
package:test_api/src/remote_listener.dart 64:27 RemoteListener.start
/var/folders/8w/l56h825n7rj73d6nyts8712w0000gn/T/flutter_tools.OTjbwB/flutter_test_listener.C7BD69/listener.dart 16:25 serializeSuite
/var/folders/8w/l56h825n7rj73d6nyts8712w0000gn/T/flutter_tools.OTjbwB/flutter_test_listener.C7BD69/listener.dart 41:36 main
dart:ui/hooks.dart 231:25 _runMainZoned..
dart:async/zone.dart 1190:13 _rootRun
dart:async/zone.dart 1093:19 _CustomZone.run
dart:async/zone.dart 1630:10 _runZoned
dart:async/zone.dart 1618:12 runZonedGuarded
dart:ui/hooks.dart 223:5 _runMainZoned.
dart:isolate-patch/isolate_patch.dart 301:19 _startIsolate.
dart:isolate-patch/isolate_patch.dart 168:12 _RawReceivePortImpl._handleMessage

Failed to load "/Users/danilo/AndroidStudioProjects/flutter_genogram/test/features/access_management/domain/entities/email_address_test.dart": Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4)

@gspanoae
Copy link

gspanoae commented Dec 21, 2020

Same issue here...
Upgraded to MacOS Big Sur and then started to have two issue types :

  1. with antivirus: had to stop the shields like here (see this Switch off these Core Shields if using Avast Security)

  2. then some of the unit tests are failing with :

00:19 +37 -11: loading /Volumes/data/project/test/widgets/timeline/timeline_tabs_test.dart [E]
  Failed to load "/Volumes/data/project/test/widgets/timeline/timeline_tabs_test.dart":
  Shell subprocess cleanly reported an error before connecting to test harness. Check the logs above for an error message.
  Test: /Volumes/data/project/test/widgets/timeline/timeline_tabs_test.dart
  Shell: /Volumes/data/app/flutter/bin/cache/artifacts/engine/darwin-x64/flutter_tester

or

00:17 +32 -9: loading /Volumes/data/project/test/widgets/main_dashboard/card_carousel_test.dart [E]
  Failed to load "/Volumes/data/project/test/widgets/main_dashboard/card_carousel_test.dart": Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4)
  dart:io-patch/directory_patch.dart 64:5                                                                                 _uriBaseClosure
  dart:core-patch/uri_patch.dart 21:41                                                                                    Uri.base
  package:path/src/style.dart 41:13                                                                                       Style._getPlatformStyle
  package:path/src/style.dart 33:33                                                                                       Style.platform
  package:path/src/style.dart                                                                                             Style.platform
  package:flutter_test/src/_goldens_io.dart 70:52                                                                         LocalFileComparator._getPath
  package:flutter_test/src/_goldens_io.dart 74:34                                                                         LocalFileComparator._getBasedir
  package:flutter_test/src/_goldens_io.dart 66:17                                                                         new LocalFileComparator
  /var/folders/6j/m454ngwn5qd9zypgmsdj5bwr0000gn/T/flutter_tools.gyPUJQ/flutter_test_listener.F097dP/listener.dart 43:32  main.<fn>
  package:test_api/src/remote_listener.dart 69:27                                                                         RemoteListener.start.<fn>.<fn>.<fn>
  dart:async/zone.dart 1190:13                                                                                            _rootRun
  dart:async/zone.dart 1093:19                                                                                            _CustomZone.run
  dart:async/zone.dart 1630:10                                                                                            _runZoned
  dart:async/zone.dart 1618:12                                                                                            runZonedGuarded
  package:test_api/src/remote_listener.dart 66:9                                                                          RemoteListener.start.<fn>.<fn>
  dart:async/zone.dart 1190:13                                                                                            _rootRun
  dart:async/zone.dart 1093:19                                                                                            _CustomZone.run
  dart:async/zone.dart 1630:10                                                                                            _runZoned
  dart:async/zone.dart 1550:10                                                                                            runZoned
  package:test_api/src/backend/stack_trace_formatter.dart 42:7                                                            StackTraceFormatter.asCurrent
  package:test_api/src/remote_listener.dart 65:29                                                                         RemoteListener.start.<fn>
  dart:async/zone.dart 1190:13                                                                                            _rootRun
  dart:async/zone.dart 1093:19                                                                                            _CustomZone.run
  dart:async/zone.dart 1630:10                                                                                            _runZoned
  dart:async/zone.dart 1550:10                                                                                            runZoned
  package:test_api/src/suite_channel_manager.dart 35:7                                                                    SuiteChannelManager.asCurrent
  package:test_api/src/remote_listener.dart 64:27                                                                         RemoteListener.start
  /var/folders/6j/m454ngwn5qd9zypgmsdj5bwr0000gn/T/flutter_tools.gyPUJQ/flutter_test_listener.F097dP/listener.dart 16:25  serializeSuite
  /var/folders/6j/m454ngwn5qd9zypgmsdj5bwr0000gn/T/flutter_tools.gyPUJQ/flutter_test_listener.F097dP/listener.dart 41:36  main
  dart:ui/hooks.dart 231:25                                                                                               _runMainZoned.<fn>.<fn>
  dart:async/zone.dart 1190:13                                                                                            _rootRun
  dart:async/zone.dart 1093:19                                                                                            _CustomZone.run
  dart:async/zone.dart 1630:10                                                                                            _runZoned
  dart:async/zone.dart 1618:12                                                                                            runZonedGuarded
  dart:ui/hooks.dart 223:5                                                                                                _runMainZoned.<fn>
  dart:isolate-patch/isolate_patch.dart 301:19                                                                            _startIsolate.<fn>
  dart:isolate-patch/isolate_patch.dart 168:12                                                                            _RawReceivePortImpl._handleMessage

@jmagman
Copy link
Author

jmagman commented Dec 21, 2020

@gspanoae @sgorbyo

Do you see any suspicious logs in Console when you reproduce that could give a hint as to what's interrupting the call? Maybe from syspolicyd or kernel?

@gspanoae
Copy link

@jmagman good tip, thanks.. after looking better I could spot my avast premium security antivirus having something to do with this
i did try several ways to configure it (e.g. including stoping all shields and any scanning!?) but in the end, i had to uninstall avast and now the tests are working - not too happy about it but at least I can continue for now

@haamaanaa
Copy link

@jmagman I already had to downgrade back to Catalina to be able to work, so cannot check errors anymore

@sgorbyo
Copy link

sgorbyo commented Dec 22, 2020

I can confirm that, also in my case, removing Avira solved the issue.

@srawlins srawlins added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Dec 24, 2020
@haamaanaa
Copy link

I just upgraded my Macbook Air back to Big Sur and problem still persists, flutter unit tests fail the same way.

I had a Macbook Pro installed also with Big Sur MacOS and it did not face the same issue with flutter tests.

only difference between these machines is that Macbook pro does not have company mandated MS ATP software installed.

Now.... I cannot uninstall the MS ATP software as that is against company policy, so would be really good that some help could be found from here as well....

@jmagman jmagman changed the title Error: Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4) Error: Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4), antivirus related Jan 19, 2021
@haamaanaa
Copy link

We also verified that removing Microsoft ATP "solves" the issue of running flutter tests....

but that cannot be the solution in real world, can it?

@ihorvitruk
Copy link

Duplicated from #70940

I faced the same issue, when I migrated to Big Sur. Now I have Big Sur 11.2, but the issue with tests running is still reproducible.

I managed to find temporary workaround for it: to run command with concurrency parameter set to 1 (by default it is 10):

flutter test --concurrency 1

In 95% of runs, error does not appear, but in rest 5% - it does.
I suppose, error is somehow related to filesystem access or some access race condition. And I do not rely on my temporary solution, because it decrease running time (because only 1 job is used).

I believe the issue will be investigated and fixed asap.

@haamaanaa
Copy link

@ihorvitruk do you also have MS ATP security app installed? or some other security scanner app?

@haamaanaa
Copy link

haamaanaa commented Feb 17, 2021

to test with MacOS BigSur + [insert AV scanner here]

import 'package:test/test.dart';

void main() {
  test('Test BigSur vs Flutter', () {
    expect(1, 1);
  });
}

fails after some random amount of tries, at least with MS ATP scanner enabled

base % flutter test test/data/test.dart
00:02 +1: All tests passed!                                                                      
                                                          
base % flutter test test/data/test.dart
00:02 +0: loading /Users/mua/dev/projects/some/packages/base/test/data/test.dart                       
Shell: [ERROR:flutter/shell/testing/tester_main.cc(302)] Unhandled exception
Shell: Exception: FileSystemException: Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4)
Shell: Stack trace: #0      _uriBaseClosure (dart:io-patch/directory_patch.dart:64:5)
Shell: #1      Uri.base (dart:core-patch/uri_patch.dart:21:41)

@ihorvitruk
Copy link

ihorvitruk commented Feb 18, 2021

@haamaanaa no, I don't have MS ATP installed, but I have Jamf (appeared in Big Sur) and SentinelOne (was also in Catalina, when tests ran ok)

@jpsiitonen
Copy link
Contributor

I faced the same issue, running: MacOs Big Sur with Avast Antivirus.

In the test case I was just reading file.

Noticed that if I disable "File shield" feature from Avast it will not reproduce.

Workaround is to use that flutter test --concurrency 1

@haamaanaa
Copy link

haamaanaa commented Mar 12, 2021

Upgraded to BigSur 11.2.3 today and it solved issue for about 98,6%, even with having antivirus program installed & running. we are also using flutter 2 now.

11.2.3 release notes say: Processing maliciously crafted web content may lead to arbitrary code execution

Running tests in test suite (like with command-line command flutter test) still fails a one random class about 10% of tries. same test succeeds in isolation about 98,6 success rate. earlier when running test suite, more than half test classes would fail, now only singular class fails, sometimes

So something was made better, but still not 100% "there"

@spironato
Copy link

spironato commented Mar 15, 2021

I updated my Mac to BigSure 11.2.3 and actually faced the same issue: always and multiple times, running the unit tests, getting the same error Getting current working directory failed, path = '' (OS Error: Interrupted system call, errno = 4):

I have same as @haamaanaa Microsoft Defender ATP.

After update to latest version of Microsoft Defender ATP then failure happen anyway and randomly time to time in the same way as above loading the test.

@ihorvitruk
Copy link

ihorvitruk commented Apr 19, 2021

Good news from my side: I found a new workaround. It can be used until the issue is fixed (no matter by whom).

Workaround is to use Retry annotation (https://api.flutter.dev/flutter/test_api/Retry-class.html)

Annotation should be added to the top of the file with tests. Documentation from the above link says: A test with retries enabled will be re-run if it fails for a reason other than TestFailure. It means, current issue situation is the exact case, when this annotation should be used. If error Interrupted system call, errno = 4 occurs, test is just run again until it succeed or TestFailure happened or maximum retries count is reached.

I added @Retry(10) to test files in my project, but in practice, 4 - is the maximum retries count that I saw. All of the retries are done at the same second of time, it means, that even if you have hundreds or even thousands of tests, tests running time will not be increased a lot.

@kuhnroyal
Copy link
Contributor

If your Anti virus software supports exclusions for real-time scan, you can try excluding your workspace/project folder and maybe the temp folder or /private/var/folders on BigSur.
Seems to work for now.

@viatsko
Copy link

viatsko commented Apr 27, 2021

The latest Big Sur update has been pushed out. Upgrading macOS should solve the issue with Microsoft Defender ATP and Interrupted system call.

@kuhnroyal
Copy link
Contributor

I can confirm that this no longer fails after the MacOS 11.3 update. @viatsko Do you have any background information on why this is?

@haamaanaa
Copy link

haamaanaa commented Apr 30, 2021

It might also be that Microsoft have pushed an update to MS ATP itself with automated updates

Have to check if was fixed for us as well....

EDIT: indeed, error seems to have gone the way of Moas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

10 participants