Persist TestrunMessages and store timestamp
So far, the Testrun messages are in addition to the Tesstrun.output column
This commit is contained in:
@ -33,7 +33,7 @@ class Runner::Strategy
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
def attach_to_execution(_command, _event_loop)
|
||||
def attach_to_execution(_command, _event_loop, _starting_time)
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
||||
|
@ -108,7 +108,7 @@ class Runner::Strategy::DockerContainerPool < Runner::Strategy
|
||||
Rails.logger.debug { "#{Time.zone.now.getutc.inspect}: Finished copying files" }
|
||||
end
|
||||
|
||||
def attach_to_execution(command, event_loop)
|
||||
def attach_to_execution(command, event_loop, starting_time)
|
||||
reset_inactivity_timer
|
||||
|
||||
@command = command
|
||||
@ -119,7 +119,7 @@ class Runner::Strategy::DockerContainerPool < Runner::Strategy
|
||||
begin
|
||||
Timeout.timeout(@execution_environment.permitted_execution_time) do
|
||||
socket.send_data(command)
|
||||
yield(socket)
|
||||
yield(socket, starting_time)
|
||||
event_loop.wait
|
||||
event_loop.stop
|
||||
end
|
||||
|
@ -25,11 +25,11 @@ class Runner::Strategy::Null < Runner::Strategy
|
||||
|
||||
def copy_files(_files); end
|
||||
|
||||
def attach_to_execution(command, event_loop)
|
||||
def attach_to_execution(command, event_loop, starting_time)
|
||||
socket = Connection.new(nil, self, event_loop)
|
||||
# We don't want to return an error if the execution environment is changed
|
||||
socket.status = :terminated_by_codeocean if command == ExecutionEnvironment::VALIDATION_COMMAND
|
||||
yield(socket)
|
||||
yield(socket, starting_time)
|
||||
socket
|
||||
end
|
||||
|
||||
|
@ -133,10 +133,10 @@ class Runner::Strategy::Poseidon < Runner::Strategy
|
||||
Rails.logger.debug { "#{Time.zone.now.getutc.inspect}: Finished copying files" }
|
||||
end
|
||||
|
||||
def attach_to_execution(command, event_loop)
|
||||
def attach_to_execution(command, event_loop, starting_time)
|
||||
websocket_url = execute_command(command)
|
||||
socket = Connection.new(websocket_url, self, event_loop)
|
||||
yield(socket)
|
||||
yield(socket, starting_time)
|
||||
socket
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user