diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6569f1f8102..027c061cf28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,6 @@ jobs: # Release builds - os: macos-15 config: "release" - # https://github.com/zeroc-ice/ice/issues/2061 - test_flags: "--rfilter=csharp/Ice/adapterDeactivation" - os: ubuntu-24.04 config: "release" - os: windows-2022 @@ -42,8 +40,7 @@ jobs: - os: macos-15 config: "debug" build_flags: "OPTIMIZE=no" - # https://github.com/zeroc-ice/ice/issues/2061 - test_flags: "--swift-config=debug --rfilter=csharp/Ice/adapterDeactivation" + test_flags: "--swift-config=debug" - os: ubuntu-24.04 config: "debug" build_flags: "OPTIMIZE=no" diff --git a/cpp/src/Ice/WSTransceiver.cpp b/cpp/src/Ice/WSTransceiver.cpp index b75c44a596f..d667d4202f7 100644 --- a/cpp/src/Ice/WSTransceiver.cpp +++ b/cpp/src/Ice/WSTransceiver.cpp @@ -218,6 +218,12 @@ IceInternal::WSTransceiver::initialize(Buffer& readBuffer, Buffer& writeBuffer) } assert(_writeBuffer.i == _writeBuffer.b.end()); _state = StateUpgradeResponsePending; + + if (_instance->traceLevel() >= 1) + { + Trace out(_instance->logger(), _instance->traceCategory()); + out << "sent " << protocol() << " connection HTTP upgrade request\n" << toString(); + } } while (true) diff --git a/cpp/src/IceBox/Admin.cpp b/cpp/src/IceBox/Admin.cpp index 7ebe7ab418d..612587217d0 100644 --- a/cpp/src/IceBox/Admin.cpp +++ b/cpp/src/IceBox/Admin.cpp @@ -10,15 +10,7 @@ using namespace std; using namespace IceInternal; -int run(const Ice::StringSeq&); - -Ice::CommunicatorPtr communicator; - -void -destroyCommunicator(int) -{ - communicator->destroy(); -} +int run(const Ice::CommunicatorPtr&, const Ice::StringSeq&); int #ifdef _WIN32 @@ -39,11 +31,9 @@ main(int argc, char* argv[]) Ice::CommunicatorHolder ich{argc, argv, initData}; - communicator = ich.communicator(); - - ctrlCHandler.setCallback(&destroyCommunicator); + ctrlCHandler.setCallback([communicator = ich.communicator()](int) { communicator->destroy(); }); - status = run(Ice::argsToStringSeq(argc, argv)); + status = run(ich.communicator(), Ice::argsToStringSeq(argc, argv)); } catch (const std::exception& ex) { @@ -69,7 +59,7 @@ usage(const string& name) } int -run(const Ice::StringSeq& args) +run(const Ice::CommunicatorPtr& communicator, const Ice::StringSeq& args) { IceInternal::Options opts; opts.addOpt("h", "help"); diff --git a/csharp/src/Ice/Internal/WSTransceiver.cs b/csharp/src/Ice/Internal/WSTransceiver.cs index e603a2d5882..a8e77b31122 100644 --- a/csharp/src/Ice/Internal/WSTransceiver.cs +++ b/csharp/src/Ice/Internal/WSTransceiver.cs @@ -91,6 +91,13 @@ public int initialize(Buffer readBuffer, Buffer writeBuffer, ref bool hasMoreDat } Debug.Assert(!_writeBuffer.b.hasRemaining()); _state = StateUpgradeResponsePending; + + if (_instance.traceLevel() >= 1) + { + _instance.logger().trace( + _instance.traceCategory(), + "sent " + protocol() + " connection HTTP upgrade request\n" + ToString()); + } } while (true) diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/FileLoggerI.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/FileLoggerI.java index 896dfac0d91..649fb66f58d 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/FileLoggerI.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/FileLoggerI.java @@ -9,13 +9,13 @@ final class FileLoggerI extends LoggerI { super(prefix); if (file.isEmpty()) { - throw new InitializationException("FileLogger: file name is empty"); + throw new FileException("FileLogger: file name is empty"); } try { _out = new java.io.FileOutputStream(new java.io.File(file), true); } catch (java.io.FileNotFoundException ex) { - throw new InitializationException("FileLogger: cannot open " + file); + throw new FileException("FileLogger: cannot open '" + file + "': file not found", ex); } } diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/Instance.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/Instance.java index e0243a22f31..27c1dd91699 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/Instance.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/Instance.java @@ -934,7 +934,7 @@ public void initialize(Communicator communicator, InitializationData initData) { } else { _cacheMessageBuffers = properties.getIcePropertyAsInt("Ice.CacheMessageBuffers"); } - } catch (LocalException ex) { + } catch (Exception ex) { destroy(false); throw ex; } diff --git a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/WSTransceiver.java b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/WSTransceiver.java index f9bc26bf8fd..6c04ab0bb01 100644 --- a/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/WSTransceiver.java +++ b/java/src/com.zeroc.ice/src/main/java/com/zeroc/Ice/WSTransceiver.java @@ -88,6 +88,17 @@ public int initialize(Buffer readBuffer, Buffer writeBuffer) { } assert (!_writeBuffer.b.hasRemaining()); _state = StateUpgradeResponsePending; + + if (_instance.traceLevel() >= 1) { + _instance + .logger() + .trace( + _instance.traceCategory(), + "sent " + + protocol() + + " connection HTTP upgrade request\n" + + toString()); + } } while (true) { diff --git a/java/test/android/controller/src/main/java/com/zeroc/testcontroller/ControllerApp.java b/java/test/android/controller/src/main/java/com/zeroc/testcontroller/ControllerApp.java index 933002e8886..c0f1058ea52 100644 --- a/java/test/android/controller/src/main/java/com/zeroc/testcontroller/ControllerApp.java +++ b/java/test/android/controller/src/main/java/com/zeroc/testcontroller/ControllerApp.java @@ -197,7 +197,6 @@ public ControllerI(boolean bluetooth) initData.properties.setProperty("Ice.ThreadPool.Server.SizeMax", "10"); initData.properties.setProperty("ControllerAdapter.Endpoints", "tcp"); initData.properties.setProperty("ControllerAdapter.AdapterId", java.util.UUID.randomUUID().toString()); - initData.properties.setProperty("Ice.Override.ConnectTimeout", "1000"); if(!isEmulator()) { if(bluetooth) diff --git a/java/test/src/main/java/test/Ice/binding/AllTests.java b/java/test/src/main/java/test/Ice/binding/AllTests.java index e941291c618..5273e7f69f8 100644 --- a/java/test/src/main/java/test/Ice/binding/AllTests.java +++ b/java/test/src/main/java/test/Ice/binding/AllTests.java @@ -75,10 +75,6 @@ public static void allTests(test.TestHelper helper) { // Usually the actual type of this exception is ConnectionRefusedException, // but not always. See bug 3179. // - } catch (com.zeroc.Ice.ConnectTimeoutException ex) { - // - // On Windows, we set Ice.Override.ConnectTimeout to speed up testing. - // } } out.println("ok"); @@ -409,10 +405,6 @@ public static void allTests(test.TestHelper helper) { // Usually the actual type of this exception is ConnectionRefusedException, // but not always. See bug 3179. // - } catch (com.zeroc.Ice.ConnectTimeoutException ex) { - // - // On Windows, we set Ice.Override.ConnectTimeout to speed up testing. - // } Endpoint[] endpoints = test.ice_getEndpoints(); @@ -467,10 +459,6 @@ public static void allTests(test.TestHelper helper) { // Usually the actual type of this exception is ConnectionRefusedException, // but not always. See bug 3179. // - } catch (com.zeroc.Ice.ConnectTimeoutException ex) { - // - // On Windows, we set Ice.Override.ConnectTimeout to speed up testing. - // } } out.println("ok"); @@ -585,10 +573,6 @@ public static void allTests(test.TestHelper helper) { // Usually the actual type of this exception is ConnectionRefusedException, // but not always. See bug 3179. // - } catch (com.zeroc.Ice.ConnectTimeoutException ex) { - // - // On Windows, we set Ice.Override.ConnectTimeout to speed up testing. - // } Endpoint[] endpoints = test.ice_getEndpoints(); @@ -656,10 +640,6 @@ public static void allTests(test.TestHelper helper) { // Usually the actual type of this exception is ConnectionRefusedException, // but not always. See bug 3179. // - } catch (com.zeroc.Ice.ConnectTimeoutException ex) { - // - // On Windows, we set Ice.Override.ConnectTimeout to speed up testing. - // } Endpoint[] endpoints = test.ice_getEndpoints(); @@ -753,10 +733,6 @@ public static void allTests(test.TestHelper helper) { // Usually the actual type of this exception is ConnectionRefusedException, // but not always. See bug 3179. // - } catch (com.zeroc.Ice.ConnectTimeoutException ex) { - // - // On Windows, we set Ice.Override.ConnectTimeout to speed up testing. - // } deactivate(rcom, adapters); diff --git a/js/test/Common/ControllerI.js b/js/test/Common/ControllerI.js index a8c349b0b24..7c0ecd35cd4 100644 --- a/js/test/Common/ControllerI.js +++ b/js/test/Common/ControllerI.js @@ -154,7 +154,6 @@ export async function runController(clientOutput, serverOutput, scripts) { const initData = new Ice.InitializationData(); initData.logger = new Logger(out); initData.properties = Ice.createProperties(); - initData.properties.setProperty("Ice.Override.ConnectTimeout", "1000"); async function registerProcessController(adapter, registry, processController) { try { diff --git a/ruby/test/Ice/exceptions/AllTests.rb b/ruby/test/Ice/exceptions/AllTests.rb index d0cdb3e87c5..2f06d841ef2 100644 --- a/ruby/test/Ice/exceptions/AllTests.rb +++ b/ruby/test/Ice/exceptions/AllTests.rb @@ -18,25 +18,17 @@ def allTests(helper, communicator) print "testing value factory registration exception... " STDOUT.flush vf = ValueFactoryI.new - - vfm = communicator.getValueFactoryManager() - test(vfm.class == Ice::ValueFactoryManager) # created by the C++ code - - vfm.add(vf, "x") + communicator.getValueFactoryManager().add(vf, "x") begin - vfm.add(vf, "x") + communicator.getValueFactoryManager().add(vf, "x") test(false) - rescue Ice::AlreadyRegisteredException => ex - test(ex.kindOfObject == "value factory") - test(ex.id == "x") + rescue Ice::AlreadyRegisteredException end - vfm.add(vf, "") + communicator.getValueFactoryManager().add(vf, "") begin - vfm.add(vf, "") + communicator.getValueFactoryManager().add(vf, "") test(false) - rescue Ice::AlreadyRegisteredException => ex - test(ex.kindOfObject == "value factory") - test(ex.id == "") + rescue Ice::AlreadyRegisteredException end puts "ok" diff --git a/ruby/test/Ice/objects/AllTests.rb b/ruby/test/Ice/objects/AllTests.rb index 5d712bc8b5b..1bd404c5ce8 100644 --- a/ruby/test/Ice/objects/AllTests.rb +++ b/ruby/test/Ice/objects/AllTests.rb @@ -40,15 +40,13 @@ def test(b) def allTests(helper, communicator) factory = MyValueFactory.new - valueFactoryManager = communicator.getValueFactoryManager() - test(valueFactoryManager != nil) - valueFactoryManager.add(factory, '::Test::B') - valueFactoryManager.add(factory, '::Test::C') + communicator.getValueFactoryManager().add(factory, '::Test::B') + communicator.getValueFactoryManager().add(factory, '::Test::C') #communicator.getValueFactoryManager().add(factory, '::Test::D') - valueFactoryManager.add(factory, '::Test::E') - valueFactoryManager.add(factory, '::Test::F') - valueFactoryManager.add(factory, '::Test::I') - valueFactoryManager.add(factory, '::Test::J') + communicator.getValueFactoryManager().add(factory, '::Test::E') + communicator.getValueFactoryManager().add(factory, '::Test::F') + communicator.getValueFactoryManager().add(factory, '::Test::I') + communicator.getValueFactoryManager().add(factory, '::Test::J') initial = Test::InitialPrx.new(communicator, "initial:#{helper.getTestEndpoint()}") diff --git a/scripts/Util.py b/scripts/Util.py index 5306555c4c7..cd9abc87fe9 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -867,11 +867,12 @@ def getProps(self, process, current): props["Ice.Override.Compress"] = "1" if self.serialize: props["Ice.ThreadPool.Server.Serialize"] = "1" - # JavaScript does not support the Ice.IPv6 property + if not isinstance(current.testsuite.getMapping(), JavaScriptMapping): + # JavaScript does not support the IPv6 properties props["Ice.IPv6"] = self.ipv6 - if self.ipv6: - props["Ice.PreferIPv6Address"] = True + if self.ipv6: + props["Ice.PreferIPv6Address"] = True if self.mx: props["Ice.Admin.Endpoints"] = ( 'tcp -h "::1"' if self.ipv6 else "tcp -h 127.0.0.1" @@ -883,21 +884,6 @@ def getProps(self, process, current): props["IceMX.Metrics.Parent.GroupBy"] = "parent" props["IceMX.Metrics.All.GroupBy"] = "none" - # - # Speed up Windows testing. We override the connect timeout for some tests which are - # establishing connections to inactive ports. It takes around 1s for such connection - # establishment to fail on Windows. - # - # if isinstance(platform, Windows): - # if current.testsuite.getId().startswith("IceGrid") or \ - # current.testsuite.getId() in ["Ice/binding", - # "Ice/location", - # "Ice/background", - # "Ice/faultTolerance", - # "Ice/services", - # "IceDiscovery/simple"]: - # props["Ice.Override.ConnectTimeout"] = "400" - # Additional properties specified on the command line with --cprops or --sprops additionalProps = [] if self.cprops and isinstance(process, Client): diff --git a/scripts/tests/Ice/adapterDeactivation.py b/scripts/tests/Ice/adapterDeactivation.py index e99077122f6..e2bd7a8e1b9 100644 --- a/scripts/tests/Ice/adapterDeactivation.py +++ b/scripts/tests/Ice/adapterDeactivation.py @@ -3,7 +3,12 @@ # Copyright (c) ZeroC, Inc. All rights reserved. # -from Util import TestSuite +from Util import CSharpMapping, Darwin, TestSuite, platform, Mapping +options = {} +# Disable IPv6 for .NET on macOS until https://github.com/dotnet/runtime/pull/108334 is merged in .NET 8 +# See https://github.com/zeroc-ice/ice/issues/2061 +if (isinstance(Mapping.getByPath(__name__), CSharpMapping) and isinstance(platform, Darwin)): + options = {"ipv6": [False]} -TestSuite(__name__, multihost=False) +TestSuite(__name__, multihost=False, options=options)