Opened 4 years ago

Closed 4 years ago

# Unexpected hints for leave action in RPC ticket.getActions

Reported by: Owned by: Olemis Lang Odd Simon Simonsen low XmlRpcPlugin minor ticket workflow actions 1.0.2 1.1.0 Jun Omae 1.0

### Description

Sometimes tracrpc.tests.ticket:RpcTicketTestCase.test_getActions in Trac>=1.0 fails because «The ticket will remain with no owner.» hint is returned by controller.render_ticket_action_control (controller => ConfigurableTicketWorkflow) for leave action (instead of empty string as expected) .

After reviewing the code of trac.ticket.default_workflow:render_ticket_action_control inconsistencies may be related to the fact that the number of operations for leave action may not be 1 under certain circumstances .

### comment:1 follow-up:  2 Changed 4 years ago by Ryan J Ollos

It sounds like it is related to the change in t:#11090/ [t 11778], but that change is scheduled for 1.0.2 so I wouldn't expect it would cause a problem for you in Trac <= 1.0.1.

### comment:2 in reply to:  1 Changed 4 years ago by Olemis Lang

It sounds like it is related to the change in t:#11090/ [t 11778], but that change is scheduled for 1.0.2 so I wouldn't expect it would cause a problem for you in Trac <= 1.0.1.

Maybe that's the reason why osimons cannot reproduce this issue ? In any case IMHO , something should be done to anticipate this test failure looking forward to Trac=1.0.2 . The failure is no big deal though ...

I'm running tests against relatively recent versions of branches in Trac source code i.e.

trunk => svn-11784 1.0-stable => svn-11783 0.12-stable => svn-11768 0.11-stable => svn-10236

This error is noticed in the first two cases mentioned above .

### comment:3 Changed 4 years ago by Odd Simon Simonsen

I was sure my mirror was up-to-date, but seems I was missing some recent changes. Now I see the error too. Fix coming shortly.

### comment:4 Changed 4 years ago by Odd Simon Simonsen

Resolution: → fixed new → closed

(In [13202]) XmlRpcPlugin: Fix tests after recent text changes in workflow action hints. Closes #11109.

### comment:5 follow-up:  8 Changed 4 years ago by Odd Simon Simonsen

Hmm. More worrying is the fact that latest 1.0.2dev now leaves a stray functional server process running after tests terminate. I need to kill it manually every time.

I see there has been a number of changes to functional infrastructure in Trac recently, and from the error message I get it seems we try to do too much at exit - and failing badly (this originates from inside the new-ish trac.util.terminate():

trac/util/__init__.py:319: RuntimeWarning: Parent module 'trac.util' \
import os


I don't think we can depend on new imports succeeding at exit - we can hardly even depend on references to existing objects still being around... The new code works fine as tests run (start()/stop()/restart()), but I think trying to terminate self at exit needs to be shorter and simpler to succeed in a consistent manner. As we subclass this functional testenvironment, the lifecycle of this object is partly out of our hands.

### comment:6 Changed 4 years ago by Odd Simon Simonsen

(In [13203]) XmlRpcPlugin: Safer strategy for terminating functional test server. Refs #11109.

### comment:7 follow-up:  9 Changed 4 years ago by Odd Simon Simonsen

Following [13203] at least the server terminates consistently, but RuntimeWarning remains. However that is now just a Trac problem, and no longer a direct concern for the RPC plugin.

### comment:8 in reply to:  5 ; follow-up:  10 Changed 4 years ago by Olemis Lang

Hmm. More worrying is the fact that latest 1.0.2dev now leaves a stray functional server process running after tests terminate. I need to kill it manually every time.

that happens to me sometimes running it inside PyDev . It's annoying , yes .

Nevertheless I find more worrying the fact that test cases are not isolated . I mean , if tickets and other stuff is not appropriately torn down then these might interfere with assertions in subsequent test cases , thus polluting test reports .

[...]

### comment:9 in reply to:  7 Changed 4 years ago by Olemis Lang

Following [13203] at least the server terminates consistently, but RuntimeWarning remains. However that is now just a Trac problem, and no longer a direct concern for the RPC plugin.

I'll take a look into this , JIC ;)

### comment:10 in reply to:  8 ; follow-up:  11 Changed 4 years ago by Odd Simon Simonsen

Nevertheless I find more worrying the fact that test cases are not isolated . I mean , if tickets and other stuff is not appropriately torn down then these might interfere with assertions in subsequent test cases , thus polluting test reports .

Correct. Let's keep it at 0 failures/errors and it won't be a problem ;-) As for the larger issue of fixing the functional test infrastructure we reuse, I think I'll leave that for another day...

### comment:11 in reply to:  10 Changed 4 years ago by Olemis Lang

Nevertheless I find more worrying the fact that test cases are not isolated . I mean , if tickets and other stuff is not appropriately torn down then these might interfere with assertions in subsequent test cases , thus polluting test reports .

Correct. Let's keep it at 0 failures/errors and it won't be a problem ;-) As for the larger issue of fixing the functional test infrastructure we reuse, I think I'll leave that for another day...

JFTR , in recent changesets committed onto this fork I've been trying an approach consisting in leaving 'some' traces of previous test case activity , but still keeping the test suite immune to previous noise . However that's partially possible due to the isolation provided by product environments i.e. there will be no interference among product data as long as unique prefixes will be allocated .

Maybe something similar may be done too in tracrpc.tests

### Modify Ticket

Action
as closed The owner will remain Odd Simon Simonsen.
The resolution will be deleted. Next status will be 'reopened'.