Added logging to find race condition.
This commit is contained in:
parent
fbd99e89f3
commit
06047e249b
2 changed files with 26 additions and 31 deletions
|
@ -497,6 +497,7 @@ returns
|
||||||
# if we do not have it cached, do lookup
|
# if we do not have it cached, do lookup
|
||||||
if !updated_at
|
if !updated_at
|
||||||
o = select(:updated_at).order(updated_at: :desc).limit(1).first
|
o = select(:updated_at).order(updated_at: :desc).limit(1).first
|
||||||
|
logger.debug "result latest_change #{o.inspect}"
|
||||||
if o
|
if o
|
||||||
updated_at = o.updated_at
|
updated_at = o.updated_at
|
||||||
latest_change_set(updated_at)
|
latest_change_set(updated_at)
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class SessionBasicTicketTest < ActiveSupport::TestCase
|
class SessionBasicTicketTest < ActiveSupport::TestCase
|
||||||
test 'b ticket_overview_index' do
|
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
|
|
||||||
# create users
|
# create users
|
||||||
|
@ -21,6 +19,14 @@ class SessionBasicTicketTest < ActiveSupport::TestCase
|
||||||
roles: roles,
|
roles: roles,
|
||||||
groups: groups,
|
groups: groups,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# create ticket
|
||||||
|
ticket = Ticket.create( title: 'default overview test', group_id: 1, priority_id: 1, state_id: 1, customer_id: 1 )
|
||||||
|
sleep 6
|
||||||
|
|
||||||
|
test 'b ticket_overview_index' do
|
||||||
|
UserInfo.current_user_id = 1
|
||||||
|
|
||||||
agent1.roles = roles
|
agent1.roles = roles
|
||||||
assert( agent1.save, 'create/update agent1' )
|
assert( agent1.save, 'create/update agent1' )
|
||||||
|
|
||||||
|
@ -30,7 +36,7 @@ class SessionBasicTicketTest < ActiveSupport::TestCase
|
||||||
# get as stream
|
# get as stream
|
||||||
result1 = client1.push
|
result1 = client1.push
|
||||||
if !result1
|
if !result1
|
||||||
Rails.logger.debug "FAILD Sessions::Backend::TicketOverviewIndex push"
|
Rails.logger.error "FAILD Sessions::Backend::TicketOverviewIndex push"
|
||||||
end
|
end
|
||||||
assert( result1, 'check ticket_overview_index' )
|
assert( result1, 'check ticket_overview_index' )
|
||||||
|
|
||||||
|
@ -53,23 +59,8 @@ class SessionBasicTicketTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'b ticket_overview_list' do
|
test 'b ticket_overview_list' do
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
UserInfo.current_user_id = 1
|
||||||
|
|
||||||
# create users
|
|
||||||
roles = Role.where( name: [ 'Agent' ] )
|
|
||||||
groups = Group.all
|
|
||||||
|
|
||||||
agent1 = User.create_or_update(
|
|
||||||
login: 'session-basic-ticket-agent-1',
|
|
||||||
firstname: 'Session',
|
|
||||||
lastname: 'session basic ' + rand(99_999).to_s,
|
|
||||||
email: 'session-basic-ticket-agent-1@example.com',
|
|
||||||
password: 'agentpw',
|
|
||||||
active: true,
|
|
||||||
roles: roles,
|
|
||||||
groups: groups,
|
|
||||||
)
|
|
||||||
agent1.roles = roles
|
agent1.roles = roles
|
||||||
assert( agent1.save, 'create/update agent1' )
|
assert( agent1.save, 'create/update agent1' )
|
||||||
|
|
||||||
|
@ -79,6 +70,9 @@ class SessionBasicTicketTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
# get as stream
|
# get as stream
|
||||||
result1 = client1.push
|
result1 = client1.push
|
||||||
|
if !result1
|
||||||
|
Rails.logger.error "FAILD Sessions::Backend::TicketOverviewList push"
|
||||||
|
end
|
||||||
assert( result1, 'check ticket_overview_list' )
|
assert( result1, 'check ticket_overview_list' )
|
||||||
|
|
||||||
# next check should be empty / no changes
|
# next check should be empty / no changes
|
||||||
|
|
Loading…
Reference in a new issue