Bug 534317 - (RHQ-1125) test cases leave data in database
test cases leave data in database
Product: RHQ Project
Classification: Other
Component: Tests (Show other bugs)
All All
low Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
: FutureFeature, Task
Depends On:
  Show dependency treegraph
Reported: 2008-11-17 10:27 EST by John Mazzitelli
Modified: 2011-04-20 19:50 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-04-20 19:50:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Mazzitelli 2008-11-17 10:27:00 EST
I just ran a full test on my box.  I first ensured I had an empty DB (-Ddbsetup), I then ran:

mvn -Pdev,enterprise install

After 14 minutes, all tests pass and my build was successful.

However, I then looked in the database and found some tables still had data in it that should not be.  The data looks like test data which should have been cleaned up after a successful test run.  The tables with data in them (that should not be there) is:


I think some of this leftover data is causing future test runs to fail
Comment 1 John Mazzitelli 2008-11-17 10:32:53 EST
Here is some of the data leftover that might help track down the offending tests:

* rhq_config_prop_grp_def

id		name		display_name	description	default_hidden	order_index
500050	Basic Group	(null)			(null)		true				0

* rhq_config_property

id	configuration_id	string_value	override	name	dtype	parent_list_id	parent_map_id	list_index	error_message
501190	509734	testValue	(null)	testProperty	property	(null)	(null)	(null)	(null)
501191	509753	value1	false	property1	property	(null)	(null)	(null)	(null)
501060	509587	test-value!	(null)	param1	property	(null)	(null)	(null)	(null)
501192	509754	value1	(null)	property1	property	(null)	(null)	(null)	(null)
501193	509757	value1	false	property1	property	(null)	(null)	(null)	(null)
501063	509622	group-test	(null)	param1	property	(null)	(null)	(null)	(null)
501064	509622	blah	(null)	param2	property	(null)	(null)	(null)	(null)
501194	509758	value1	(null)	property1	property	(null)	(null)	(null)	(null)
500552	508593	true	false	myboolean	property	(null)	(null)	(null)	(null)
500553	508594	true	false	myboolean	property	(null)	(null)	(null)	(null)
500554	508595	false	false	myboolean	property	(null)	(null)	(null)	(null)
500555	508596	false	false	myboolean	property	(null)	(null)	(null)	(null)
500556	508597	TRUE	false	myboolean	property	(null)	(null)	(null)	(null)
500557	508598	TRUE	false	myboolean	property	(null)	(null)	(null)	(null)
500558	508599	false	false	myboolean	property	(null)	(null)	(null)	(null)
500560	508613	true	false	myboolean	property	(null)	(null)	(null)	(null)
500565	508625	true	false	myboolean	property	(null)	(null)	(null)	(null)
500566	508626	false	false	myboolean	property	(null)	(null)	(null)	(null)
500568	508640	true	false	myboolean	property	(null)	(null)	(null)	(null)
500569	508641	true	false	myboolean	property	(null)	(null)	(null)	(null)
500570	508642	false	false	myboolean	property	(null)	(null)	(null)	(null)
500571	508642	7000	false	mysleep	property	(null)	(null)	(null)	(null)
500575	508649	false	false	myboolean	property	(null)	(null)	(null)	(null)
500576	508649	7000	false	mysleep	property	(null)	(null)	(null)	(null)
500579	508659	1	false	foo	property	(null)	(null)	(null)	(null)
500580	508660	2	false	bar	property	(null)	(null)	(null)	(null)
500583	508667	true	false	myboolean	property	(null)	(null)	(null)	(null)
500584	508668	true	false	myboolean	property	(null)	(null)	(null)	(null)
500586	508674	invalid-boolean	false	myboolean	property	(null)	(null)	(null)	java.lang.IllegalArgumentException: Not a valid boolean
	at org.rhq.enterprise.server.configuration.ConfigurationManagerBeanTest$TestServices$1.run(ConfigurationManagerBeanTest.java:933)
501056	509078	UPDATED	(null)	updateCSName	property	(null)	(null)	(null)	(null)

* rhq_qrtz_cron_triggers

trigger_name	trigger_group	cron_expression	time_zone_id
testConstraintViolation--testConstraintViolationCST	syncContentSource	0 0 3 * * ?	America/New_York

* rhq_qrtz_job_details

job_name	job_group	description	job_class_name	is_durable	is_volatile	is_stateful	requests_recovery	job_data
testConstraintViolation--testConstraintViolationCST	syncContentSource	(null)	org.rhq.enterprise.server.scheduler.jobs.ContentSourceSyncJob	false	false	true	false	BINARY, 34 Bytes

* rhq_qrtz_triggers

trigger_name	trigger_group	job_name	job_group	is_volatile	description	next_fire_time	prev_fire_time	trigger_state	trigger_type	start_time	end_time	calendar_name	misfire_instr	job_data
testConstraintViolation--testConstraintViolationCST	syncContentSource	testConstraintViolation--testConstraintViolationCST	syncContentSource	false	(null)	1226995200000	-1	WAITING	CRON	1226934871000	0	(null)	0	(null)

* rhq_resource

id	resource_type_id	uuid	name	resource_key	agent_id	inventory_status	connected	description	version	ctime	mtime	itime	res_configuration_id	plugin_configuration_id	modified_by	location	parent_resource_id	product_version_id
505297	501105	A                                   	A	A	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509655	509656	(null)	(null)	(null)	(null)
505298	501105	B                                   	B	B	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509657	509658	(null)	(null)	(null)	(null)
505288	501105	3                                   	3	3	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509637	509638	(null)	(null)	505298	(null)
505289	501105	2                                   	2	2	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509639	509640	(null)	(null)	505297	(null)
505290	501105	1                                   	1	1	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509641	509642	(null)	(null)	505297	(null)
505291	501105	a                                   	a	a	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509643	509644	(null)	(null)	505290	(null)
505292	501105	i                                   	i	i	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509645	509646	(null)	(null)	505291	(null)
505293	501105	ii                                  	ii	ii	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509647	509648	(null)	(null)	505291	(null)
505294	501105	b                                   	b	b	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509649	509650	(null)	(null)	505290	(null)
505295	501105	iii                                 	iii	iii	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509651	509652	(null)	(null)	505294	(null)
505296	501105	iv                                  	iv	iv	(null)	COMMITTED	false	(null)	(null)	1226934979703	1226934979703	1226934979703	509653	509654	(null)	(null)	505294	(null)

* rhq_resource_type

id	name	category	creation_data_type	create_delete_policy	singleton	supports_manual_add	description	plugin	ctime	mtime	subcategory_id	plugin_config_def_id	res_config_def_id
501105	fakeType	PLATFORM	CONFIGURATION	BOTH	false	false	(null)	fakePlugin	1226934979703	1226934979703	(null)	(null)	(null)
Comment 2 John Mazzitelli 2008-11-17 10:37:00 EST
those rhq_resource data looks like its from  RecursiveResourceGroupTest.getSimpleTree
Comment 3 John Mazzitelli 2008-11-17 10:43:24 EST
ConfigurationDefinitionTest persists data across tests - though there are test dependencies that should clean it up, there are places in here where we should combine tests and run inside a begin..rollback block so we don't risk leaking data, even on failure.
Comment 4 John Mazzitelli 2008-11-17 10:50:35 EST
ContentSourceManagerBeanTest.testConstraintViolation didn't seem to clean up all the way a content source thus leaving things in the quartz tables.
Comment 5 John Mazzitelli 2008-11-17 11:02:44 EST
OperationManagerBeanTest might be leaving data too - found test-value! in DB and its a value the test persists.
Comment 6 John Mazzitelli 2008-11-17 12:46:25 EST
fixed the quartz tables leftover data and some of the config data - see rhq-1126
Comment 7 John Mazzitelli 2008-11-17 13:32:53 EST
svn rev 2018

fixed ConfigurationDefinitionTest so it doesn't leak data and consolidated tests so it never actually commited data to the db
Comment 8 John Mazzitelli 2008-11-17 13:46:03 EST
Fixed a few things, still need to fix these tests:

RecursiveResourceGroupTest, FailoverListManagerBeanTest, OperationManagerBeanTest, ConfigurationManagerBeanTest

Here's the remainnig data that is still leaked which appear to be from one of the above:

* rhq_config (65 rows)

* rhq_config_property

id	configuration_id	string_value	override	name	dtype	parent_list_id	parent_map_id	list_index	error_message
500052	500093	true	false	myboolean	property	(null)	(null)	(null)	(null)
500053	500094	true	false	myboolean	property	(null)	(null)	(null)	(null)
500054	500095	false	false	myboolean	property	(null)	(null)	(null)	(null)
500055	500096	false	false	myboolean	property	(null)	(null)	(null)	(null)
500056	500097	TRUE	false	myboolean	property	(null)	(null)	(null)	(null)
500057	500098	TRUE	false	myboolean	property	(null)	(null)	(null)	(null)
500058	500099	false	false	myboolean	property	(null)	(null)	(null)	(null)
500060	500113	true	false	myboolean	property	(null)	(null)	(null)	(null)
500065	500125	true	false	myboolean	property	(null)	(null)	(null)	(null)
500066	500126	false	false	myboolean	property	(null)	(null)	(null)	(null)
500068	500140	true	false	myboolean	property	(null)	(null)	(null)	(null)
500069	500141	true	false	myboolean	property	(null)	(null)	(null)	(null)
500070	500142	false	false	myboolean	property	(null)	(null)	(null)	(null)
500071	500142	7000	false	mysleep	property	(null)	(null)	(null)	(null)
500075	500149	false	false	myboolean	property	(null)	(null)	(null)	(null)
500076	500149	7000	false	mysleep	property	(null)	(null)	(null)	(null)
500079	500159	1	false	foo	property	(null)	(null)	(null)	(null)
500080	500160	2	false	bar	property	(null)	(null)	(null)	(null)
500083	500167	true	false	myboolean	property	(null)	(null)	(null)	(null)
500084	500168	true	false	myboolean	property	(null)	(null)	(null)	(null)
500086	500174	invalid-boolean	false	myboolean	property	(null)	(null)	(null)	java.lang.IllegalArgumentException: Not a valid boolean
	at org.rhq.enterprise.server.configuration.ConfigurationManagerBeanTest$TestServices$1.run(ConfigurationManagerBeanTest.java:933)
500190	501334	testValue	(null)	testProperty	property	(null)	(null)	(null)	(null)
500191	501353	value1	false	property1	property	(null)	(null)	(null)	(null)
500192	501354	value1	(null)	property1	property	(null)	(null)	(null)	(null)
500193	501357	value1	false	property1	property	(null)	(null)	(null)	(null)
500194	501358	value1	(null)	property1	property	(null)	(null)	(null)	(null)
500560	501187	test-value!	(null)	param1	property	(null)	(null)	(null)	(null)
500563	501222	group-test	(null)	param1	property	(null)	(null)	(null)	(null)
500564	501222	blah	(null)	param2	property	(null)	(null)	(null)	(null)

* rhq_partition_event (216 rows, same as before)

* rhq_resource (11 rows, same as before)

* rhq_resource_type (1 row, same as before)
Comment 9 Jay Shaughnessy 2008-11-18 10:20:28 EST
Improved FailoverListManagerBeanTest cleanup logic.  It was leaving behind some PartitionEvent rows, which in turn left PartitionDetails, FailoverLists and FailoverDetails.  This should all be good, now.
Comment 10 Jay Shaughnessy 2008-11-19 16:21:44 EST
r2036 Updated tests to clean up debris in rhq_config (22 of 65)), rhq_resource (11 of 11) and rhq_resource_type (1 of 1)
Comment 11 Red Hat Bugzilla 2009-11-10 15:24:30 EST
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1125
This bug relates to RHQ-1128
This bug is incorporated by RHQ-1126
Comment 12 wes hayutin 2010-02-16 10:44:54 EST
mass move off the qa triage list.  These are tasks for dev.
Comment 13 Corey Welton 2010-08-18 11:19:19 EDT
jay, what's the current state of this - is it still an issue?
Comment 14 Jay Shaughnessy 2010-08-18 16:09:30 EDT
I'm sure there must still be stuff left in the db after a set of test runs. It was a year and a half ago when this last saw activity, and at that time we had cleaned it up pretty well.  Now, I don't know.  I'd close this unless you want a serious effort put into a new analysis.  Our test runs don't seem to suffer too much from this sort of thing from what I've seen lately.  And now that we have maven set up to easily use separate test and dev dbs it has reduced issues of this sort by isolating the test data.
Comment 15 Mike Foley 2011-04-20 19:50:39 EDT
no longer relevant per jay's comments.

Note You need to log in before you can comment on or make changes to this bug.