Comments (2)
After testing a couple ideas, I stumbled upon the cause of this issue. (I added a print to validate that our breakpoint was not improperly added to the increment statement. In doing so, the failure logs revealed what follows...)
In a chain of changes we sped up expression evaluation tests by combining all tests into a single input program and reusing the same page across all test cases. This made a big reduction in timeouts and made tests complete a lot faster (sometimes 5x or more). This came at a cost of loosing some isolation.
Turns out, we have a race when we advance from one test case to the next. We:
- (test 1) set a breakpoint
- (test 1) start main
- (test 1) run all checks at a breakpoint
- (test 1) remove the breakpoint
- (test 1) resume execution (running the rest of the test and the rest of
main
) - (test 1) move on to the next test set up, that is:
- (test 2) set a breakpoint
- etc
Step 6 & 7 are done by our test driver in separate process from the page. So they may complete before step 5 finishes running.
This is what trips the loop-variable test, which was the second test case using a breakpoint inside a loop.
When the previous test finished and resumed execution, the loop continued running and the breakpoint of the second loop test ends up being hit by the from from the first test. This led to broken assumptions about the state of the loop in the second test case.
A few options to bring some isolation between tests are:
- a. Don't reuse any breakpoints across tests.
- b. Ensure execution is done before step 6
- c. Don't reuse reentrant breakpoints.
(b) is requires some infra in the test driver to wait for a signal that main
finished running. This may mean monitoring that some state is updated on the page and ping the page periodically for updates until the state changes. Sounds doable but may have a performance cost that we'd like to avoid.
(a) brings isolation because the location where one test stopped is less likely to affect how another test behaves. That siad, we have many test cases that do reuse the same breakpoint for simplicity and turns out that most of them are not reentrant: that makes them in a way isolated by the fact that once resumed the breakpoint cannot be hit again.
This leads me to believe that (c) may be a simpler approach. It behaves like (a), but only requires work on tests containing loops (currently there is only 1 case of a loop breakpoint reused across 2 tests).
from sdk.
Hopefully fixed by 4e0ece2
from sdk.
Related Issues (20)
- `dart compile js` fails with the newest SDK HOT 17
- Cannot resolve top-level methods with docimports HOT 4
- [Wildcard Variables] Update `DUPLICATE_DEFINTION` reporting
- CFE fails to report error when `super` is used in a redirecting constructor. HOT 2
- DevTools not serving properly on app refresh HOT 1
- [Wildcard Variables] Update `DUPLICATE_FIELD_FORMAL_PARAMETER` reporting
- `@internal` annotation does not supress `public_member_api_docs` lint on functions HOT 1
- Dart analyzer does not infer the correct type for generic record HOT 2
- Having true cancelable future HOT 2
- Simplify branch conditions based on ranges & simplify control flow afterwards if condition turns out to be constant
- Issue in number multiplication with 10, 20, etc HOT 4
- Feature Request: Add `--insert-ignore-comments` flag to `dart fix` command for existing code HOT 3
- [vm/core] `_GrowableList.add` has unnecessary bounds check
- docImports failing to allow for resolution in some flutter animation library code HOT 4
- Implement augmentations HOT 6
- Support macros when analyzer is used as a library HOT 1
- Is that possible to set breakpoints in the macro code itself? HOT 2
- Inability to Convert Dart BigInt to JSBigInt using new js_interop HOT 1
- Dart CLI commands hang on a slow/unstable internet connection due to analytics HOT 4
- Types Generated using the LibraryTypesMacro throws an error when instantiating HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.