Skip to content
Snippets Groups Projects
Commit d1143aba authored by Alexander Polcyn's avatar Alexander Polcyn
Browse files

tweak class init test to reveal bug in misordered startup

parent c7fcebe7
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Try to catch if native gRPC class constructors are missing a 'grpc_init' # For GRPC::Core classes, which use the grpc c-core, object init
# is interesting because it's related to overall library init.
require_relative './end2end_common' require_relative './end2end_common'
...@@ -43,15 +44,35 @@ def main ...@@ -43,15 +44,35 @@ def main
case grpc_class case grpc_class
when 'channel' when 'channel'
thd = Thread.new do
GRPC::Core::Channel.new('dummy_host', nil, :this_channel_is_insecure)
end
GRPC::Core::Channel.new('dummy_host', nil, :this_channel_is_insecure) GRPC::Core::Channel.new('dummy_host', nil, :this_channel_is_insecure)
thd.join
when 'server' when 'server'
thd = Thread.new do
GRPC::Core::Server.new({})
end
GRPC::Core::Server.new({}) GRPC::Core::Server.new({})
thd.join
when 'channel_credentials' when 'channel_credentials'
thd = Thread.new do
GRPC::Core::ChannelCredentials.new
end
GRPC::Core::ChannelCredentials.new GRPC::Core::ChannelCredentials.new
thd.join
when 'call_credentials' when 'call_credentials'
thd = Thread.new do
GRPC::Core::CallCredentials.new(proc { |noop| noop })
end
GRPC::Core::CallCredentials.new(proc { |noop| noop }) GRPC::Core::CallCredentials.new(proc { |noop| noop })
thd.join
when 'compression_options' when 'compression_options'
thd = Thread.new do
GRPC::Core::CompressionOptions.new
end
GRPC::Core::CompressionOptions.new GRPC::Core::CompressionOptions.new
thd.join
else else
fail "bad --grpc_class=#{grpc_class} param" fail "bad --grpc_class=#{grpc_class} param"
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment