Skip to content

Instantly share code, notes, and snippets.

@cben
Created February 6, 2018 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cben/077f9d0c5dbfec31377ca66286bc5212 to your computer and use it in GitHub Desktop.
Save cben/077f9d0c5dbfec31377ca66286bc5212 to your computer and use it in GitHub Desktop.
tests error: undefined local variable or method `waiting' for #<VmdbDatabaseConnection:0x0055d15468c998>
~/miq/master (kubeclient-2.5|…) $ bundle exec rspec ./spec/models/vmdb_database_spec.rb ./spec/models/vmdb_database_connection_spec.rb
Randomized with seed 745
...The version of PostgreSQL being connected to is incompatible with ManageIQ (9.6+ is not supported yet)
...........The version of PostgreSQL being connected to is incompatible with ManageIQ (9.6+ is not supported yet)
The version of PostgreSQL being connected to is incompatible with ManageIQ (9.6+ is not supported yet)
The version of PostgreSQL being connected to is incompatible with ManageIQ (9.6+ is not supported yet)
.....F.The version of PostgreSQL being connected to is incompatible with ManageIQ (9.6+ is not supported yet)
..............F
Failures:
1) VmdbDatabaseConnection.log_statistics normal
Failure/Error: expect(lines.shift).to eq "MIQ(VmdbDatabaseConnection.log_statistics) <<-ACTIVITY_STATS_CSV\n"
expected: "MIQ(VmdbDatabaseConnection.log_statistics) <<-ACTIVITY_STATS_CSV\n"
got: "MIQ(VmdbDatabaseConnection.log_statistics) Unable to log stats, 'undefined local variable or method `waiting' for #<VmdbDatabaseConnection:0x0055d15468c998>\n"
(compared using ==)
Diff:
@@ -1,2 +1,2 @@
-MIQ(VmdbDatabaseConnection.log_statistics) <<-ACTIVITY_STATS_CSV
+MIQ(VmdbDatabaseConnection.log_statistics) Unable to log stats, 'undefined local variable or method `waiting' for #<VmdbDatabaseConnection:0x0055d15468c998>
# ./spec/models/vmdb_database_connection_spec.rb:135:in `block (3 levels) in <top (required)>'
2) VmdbDatabase.report_client_connections will return an array of hashes and verify hash keys for client connections query
Failure/Error:
select(<<-SQL, "Client Connections").to_a
SELECT client_addr AS client_address
, datname AS database
, pid AS spid
, waiting AS is_waiting
, query
FROM pg_stat_activity
ORDER BY 1, 2
SQL
ActiveRecord::StatementInvalid:
PG::UndefinedColumn: ERROR: column "waiting" does not exist
LINE 4: , waiting AS is_waiting
^
: SELECT client_addr AS client_address
, datname AS database
, pid AS spid
, waiting AS is_waiting
, query
FROM pg_stat_activity
ORDER BY 1, 2
# ./lib/extensions/ar_adapter/ar_dba.rb:23:in `client_connections'
# ./app/models/vmdb_database.rb:77:in `report_client_connections'
# ./spec/models/vmdb_database_spec.rb:77:in `block (3 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# PG::UndefinedColumn:
# ERROR: column "waiting" does not exist
# LINE 4: , waiting AS is_waiting
# ^
# ./lib/extensions/ar_adapter/ar_dba.rb:23:in `client_connections'
Finished in 48.43 seconds (files took 8.67 seconds to load)
36 examples, 2 failures
Failed examples:
rspec ./spec/models/vmdb_database_connection_spec.rb:132 # VmdbDatabaseConnection.log_statistics normal
rspec ./spec/models/vmdb_database_spec.rb:75 # VmdbDatabase.report_client_connections will return an array of hashes and verify hash keys for client connections query
Randomized with seed 745
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment