04ba26d638
This should take care of some or all flaky tests like: TypePropagationTest_Kernel | test_forEach_async_inheritedStream What was happening is that every tests adds /test.dart to AnalysisDriver, which means that this file is scheduled for analysis at some point, and then it also calls getResult() to get the resolved unit. When we resolve the file for the first time, the ByteStore is empty, so we build the corresponding Kernel file from scratch, and it has the offset. But the second time we read the Kernel file from ByteStore. So, if we manage to process the file as added first, and then as getResult(), we fail because we cannot resolve the import directive. But if we were not able to process the file as added, and just do getResult() first (which also marks the file as added as ready), we succeed. So, it was flaky. R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com Bug: https://github.com/dart-lang/sdk/issues/30863 Change-Id: I96151e3ebefcd212f2a7a1b2b22abb7d87ed4781 Reviewed-on: https://dart-review.googlesource.com/7782 Reviewed-by: Paul Berry <paulberry@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>