Which part of code the transaction warnings comes from?

Issue #294 new
Jun Aruga created an issue

I am trying to suppress warnings in the bundle exec rake test.

The motivation is to make us to detect the real unexpected warning like https://bitbucket.org/ged/ruby-pg/issues/286/warning-uriregexp-is-obsolete , seeing the unit test result on CI.

After my this pull-request ( https://github.com/ged/ruby-pg/pull/38 ) will be merged, the only 2 kind of warnings are appeared in the result of bundle exec rake test.

WARNING: there is no transaction in progress
WARNING: there is already a transaction in progress

And the actual CI’s result will be like this.

https://travis-ci.org/ged/ruby-pg/jobs/532552290

/home/travis/.rvm/rubies/ruby-2.6.3/bin/ruby -I/home/travis/.rvm/gems/ruby-2.6.3/gems/rspec-support-3.8.0/lib:/home/travis/.rvm/gems/ruby-2.6.3/gems/rspec-core-3.8.0/lib /home/travis/.rvm/gems/ruby-2.6.3/gems/rspec-core-3.8.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb -Ispec:lib
Run options:
  include {:focus=>true}
  exclude {:windows=>true}
All examples were filtered out; ignoring {:focus=>true}
Randomized with seed 55985
...........................................................................................................................................................................................................................................................................................................................................................................................WARNING:  there is no transaction in progress
.WARNING:  there is no transaction in progress
..WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
................WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
...WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
...WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
..WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
............................................................................................................................................................WARNING:  there is no transaction in progress
.WARNING:  there is no transaction in progress
..................WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
...WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
.....WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
...WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
...WARNING:  there is already a transaction in progress
WARNING:  there is no transaction in progress
................................
Finished in 1 minute 16.7 seconds (files took 0.22911 seconds to load)
627 examples, 0 failures

My question is do you know which part of the source code outputs these 2 types of warnings?
Could you give me some advises?
I have a motivation to suppress the remaining warnings.

Thank you.

Comments (1)

  1. Chris Bandy

    Jun, this looks like information that comes back from the server. For example,

    $ psql -q -c 'rollback'
    WARNING:  there is no transaction in progress
    
    $ psql -q -c 'begin' -c 'begin'
    WARNING:  there is already a transaction in progress
    
    $ psql -q -v 'VERBOSITY=verbose' -c 'rollback'
    WARNING:  25P01: there is no transaction in progress
    LOCATION:  UserAbortTransactionBlock, xact.c:3784
    
    $ psql -q -v 'VERBOSITY=verbose' -c 'begin' -c 'begin'
    WARNING:  25001: there is already a transaction in progress
    LOCATION:  BeginTransactionBlock, xact.c:3494
    

    I don’t have a Ruby shell in front of me to test how these statements behave in the gem, but maybe that’s a start for you?

  2. Log in to comment