| Summary: | Preferences test failures | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Remy Suen <remy.suen> |
| Component: | Node | Assignee: | Remy Suen <remy.suen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | steve_northover |
| Version: | 13.0 | ||
| Target Milestone: | 15.0 | ||
| Hardware: | PC | ||
| OS: | Windows 10 | ||
| Whiteboard: | |||
|
Description
Remy Suen
(In reply to Remy Suen from comment #0) > 1) prefs when prefs.json exists and we PUT a single key should update the > value: > > AssertionError: expected { bar: 123, qux: 'q' } to deeply equal { bar: > 'modified', qux: 'q' } > + expected - actual > > { > - "bar": 123 > + "bar": "modified" > "qux": "q" > } This first failure is due to the asynchronous nature of the preferences implementation. If I change this write call to be synchronous then the test will pass without any problems. https://github.com/eclipse/orion.client/blob/master/modules/orionode/lib/controllers/prefs.js#L174 (In reply to Remy Suen from comment #1) > https://github.com/eclipse/orion.client/blob/master/modules/orionode/lib/ > controllers/prefs.js#L174 This link will get old with time as it's pointing to master. Here's the "current" relevant commit as of the time of submission of this comment. https://github.com/eclipse/orion.client/blob/3a09df53a3c5bd7c06786588337de8f74009b332/modules/orionode/lib/controllers/prefs.js#L174 "synchronous" is usually bad but this is just in test code, no? (In reply to Steve Northover from comment #3) > "synchronous" is usually bad but this is just in test code, no? No. Sorry I didn't make that clear in comment 1. I meant if I changed the write code to be synchronous in the actual preferences implementation. Ok, I am thinking we are never doing this. I "fixed" this by adding a delay to the test between setting up the preferences file and running the assertions. The delay is a short 10 milliseconds but it seems to be doing the trick... https://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=4ab560f10f650264b0bc067c81898991e91509cd |