Skip to content

Conversation

@kpumuk
Copy link
Contributor

@kpumuk kpumuk commented Nov 23, 2025

An error occurs while running specs, that changes the behavior of the system under test, leading to false positive:

   NonblockingServer
   Thrift::NonblockingServer
   #<Thread:0x0000ffff67b9f138 /code/lib/rb/spec/nonblocking_server_spec.rb:147 run> terminated with exception (report_on_exception is true):
   /code/lib/rb/lib/thrift/types.rb:69:in 'Thrift.check_type': Expected Types::DOUBLE, received Integer for field seconds (Thrift::TypeError)
          from /code/lib/rb/lib/thrift/struct.rb:157:in 'block in SpecNamespace::NonblockingService::Sleep_args#field_accessor'
          from /code/lib/rb/lib/thrift/client.rb:41:in 'block in Thrift::Client#send_message_args'
          from /code/lib/rb/lib/thrift/client.rb:40:in 'Hash#each'
          from /code/lib/rb/lib/thrift/client.rb:40:in 'Thrift::Client#send_message_args'
          from /code/lib/rb/lib/thrift/client.rb:30:in 'Thrift::Client#send_message'
          from /code/lib/rb/spec/gen-rb/nonblocking_service.rb:75:in 'SpecNamespace::NonblockingService::Client#send_sleep'
          from /code/lib/rb/spec/gen-rb/nonblocking_service.rb:70:in 'SpecNamespace::NonblockingService::Client#sleep'
          from /code/lib/rb/spec/nonblocking_server_spec.rb:160:in 'block in RSpec::ExampleGroups::NonblockingServer::ThriftNonblockingServer#setup_client_thread'
   should kill active messages when they don't expire while shutting down

When an integer 10 is sent to "sleep", instead of actually sleeping an error happens, and the method never called, leading to no record of the method execution recorded in the result. Which is the same expectation is if the method call was aborted in the middle.

Before:

CleanShot 2025-11-22 at 20 14 01@2x

After:

CleanShot 2025-11-22 at 20 14 25@2x
  • Did you create an Apache Jira ticket? THRIFT-5909
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

@Jens-G Jens-G added the ruby label Nov 23, 2025
An error occurs while running specs, that changes the behavior of the system under test, leading to false positive:

   NonblockingServer
   Thrift::NonblockingServer
   #<Thread:0x0000ffff67b9f138 /code/lib/rb/spec/nonblocking_server_spec.rb:147 run> terminated with exception (report_on_exception is true):
   /code/lib/rb/lib/thrift/types.rb:69:in 'Thrift.check_type': Expected Types::DOUBLE, received Integer for field seconds (Thrift::TypeError)
          from /code/lib/rb/lib/thrift/struct.rb:157:in 'block in SpecNamespace::NonblockingService::Sleep_args#field_accessor'
          from /code/lib/rb/lib/thrift/client.rb:41:in 'block in Thrift::Client#send_message_args'
          from /code/lib/rb/lib/thrift/client.rb:40:in 'Hash#each'
          from /code/lib/rb/lib/thrift/client.rb:40:in 'Thrift::Client#send_message_args'
          from /code/lib/rb/lib/thrift/client.rb:30:in 'Thrift::Client#send_message'
          from /code/lib/rb/spec/gen-rb/nonblocking_service.rb:75:in 'SpecNamespace::NonblockingService::Client#send_sleep'
          from /code/lib/rb/spec/gen-rb/nonblocking_service.rb:70:in 'SpecNamespace::NonblockingService::Client#sleep'
          from /code/lib/rb/spec/nonblocking_server_spec.rb:160:in 'block in RSpec::ExampleGroups::NonblockingServer::ThriftNonblockingServer#setup_client_thread'
   should kill active messages when they don't expire while shutting down

When an integer 10 is sent to "sleep", instead of actually sleeping an error happens, and the method never called, leading to no record of the method execution recorded in the result. Which is the same expectation is if the method call was aborted in the middle.
@kpumuk kpumuk force-pushed the nonblocking-shutdown-spec branch from cb52a09 to d54d58c Compare December 2, 2025 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants