Comments (3)
ice/cpp/test/Ice/background/AllTests.cpp
Lines 134 to 151 in b25e094
What are we testing here?
We call backgroundController->pauseCall("findAdapterById");
to make the locator call block until resume is called.
Then, we test that the call to opAsync
doesn't complete immediately, which sometimes fails on Windows CI.
My understanding is that findAdapterById
isn't called here because the adapter ID is already in the locator cache.
Using chrono::milliseconds(0)
is problematic, as it seems to assume that if the locator didn't block, the call must complete immediately, which is a brittle assumption.
If I add a large delay, the test fails consistently, which shouldn't happen if the test's assumption was correct.
If I disable the locator cache, the test works, even with the large delay.
I don't see how testing locator and router facilities is relevant in this test, I think we better remove them from this test.
from ice.
It's surprising that we get this failure now. Did we ever get it before?
The tests from Ice/background
are there to make sure that an asynchronous invocation never blocks the application thread. We tests all the conditions where the async call could be blocking: hanging locator/router, various spots that could hang on connection establishment, etc.
If the locator or router hangs, opAsync
should always return without blocking and the returned std::future
should never be "ready", at least not until the locator/router call returns. That's what the locator and router tests are about.
My understanding is that findAdapterById isn't called here because the adapter ID is already in the locator cache.
Why would it already be in the locator cache? Because of the ice_ping
call which is called before? In theory the Test
adapter ID should not be cached because the findAdapterById
call should fail with an invocation timeout.
Using chrono::milliseconds(0) is problematic, as it seems to assume that if the locator didn't block, the call must complete immediately, which is a brittle assumption.
wait_for(chrono::milliseconds(0))
is just a way to check the status of the future. The status should never be equal to ready since the adapter ID shouldn't be cached and the opAsync
call should always hang on the "under-the-hood" locator findAdapterId
call.
It does sound like the adapter ID is indeed cached but it's not clear to me when. If you can easily reproduce, it would be good to figure out if and when the adapter ID gets cached before opAsync
is called.
from ice.
This call to ice_ping is causing the cache of the adapterId
ice/cpp/test/Ice/background/AllTests.cpp
Lines 134 to 137 in f983d5e
The original code in 3.7, is a bit different
ice/cpp/test/Ice/background/AllTests.cpp
Lines 269 to 272 in e545e8b
The 3.7 version pings the locator proxy, and sets a locator in the locator proxy (there is no need to set the locator there), the code in main is incorrectly sending a ping to "background@Test".
wait_for(chrono::milliseconds(0)) is just a way to check the status of the future.
Right, but I think a large delay 10ms would have catch this issue early.
from ice.
Related Issues (20)
- PR #2172 broke tracing in C#
- Enabel SSL SNI (Server Name Indication) by default
- Transmit exception message instead of ToString in C#
- Add Service.h back to Ice.h HOT 1
- Remove Glacier2::Application remnants
- Update idle timeout checks in Glacier2 session helper and IceGrid client code
- Remove null checks for string fields
- Add support for serialized method execution HOT 11
- IceBox admin configuration failures on macOS Debug
- Generated Equals for struct mapped to class in C# HOT 1
- Update macOS deployment target for C++ and Swift builds
- how to use on windwos mysys [package] [build] HOT 1
- How to bubble up Java Runtime exceptions HOT 1
- Glacier2/router browser failures
- Reformat C++ code in PHP mapping
- Remove ReapThread from IceGrid
- Fix CA2008 diagnostics in CodeAnalysis.Base.globalconfig
- Generate dispatch with SwiftSyntax in Swift
- Update slice2swift doc-comment generation
- Review handling of OutOfMemoryError in Java
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 ice.