Closed Bug 706678 Opened 14 years ago Closed 13 years ago

fix server-full `make test` to clean up/use temp names for sqlite files and log files

Categories

(Cloud Services Graveyard :: Server: Sync, defect, P4)

x86
Linux
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jrgm, Assigned: rfkelly)

References

Details

(Whiteboard: [qa+])

Attachments

(3 files)

fix server-full `make test` to clean up/use temp names for sqlite files and log files -> jrgm
Whiteboard: [qa-]
Assignee: jrgm → rkelly
Whiteboard: [qa-] → [qa+]
Blocks: 727761
The changes in Bug 740703 should resolve this problem, by ensuring that comprehensive database cleanup code is run for every test. This is much easier than using temp filenames for the database files, since the filenames are pulled out of static config files. John/James, can you please try the usual `make build; make test` with server-syncstorage master and confirm that it cleans up all the files you expect it to clean up?
Marking Resolved for :rfkelly.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Actually, I am seeing a lot of failures now on a fresh upgrade of server-full on qa1. But this may be related to other issues with that install. See http://jbonacci.pastebin.mozilla.org/1572351
This looks like an old, incompatible database file is still present in /tmp/tests.db. If you remove it manually, it should work and the database file should no longer be left behind at the end. (Note that this patch only ensures to clean up database created while running the tests, not any that might already exist on the system)
Err, since this bug is explicitly about server-full, I should backport this into the sync1.1 codebase for completeness.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Noting that this is all for sync 1.1: OK, so on qa1, the following files in /tmp were either 1. created/updated by make build, 2. created/updated by make test, or some combination of both (since they all had new time/date stamps: another-test-host.db reset.db some-test-host.db sync.db tests.db sync-error.log I cleared these out and ran "make test" again and got a clean run. But once again, I see these files left behind in /tmp: another-test-host.db reset.db some-test-host.db sync.db sync-error.log tests.db All with very current date/time stamps (for the current run of "make test") On a clean install on rhel6.build.mtv1: Right after "make build", I see these files in /tmp: account.db reset.db sync-error.log tests.db Fixes (if working for 2.0, should be back-ported to 1.1)
Moving on to sync 2.0: After two calls to "make build" (because of that dang PasteDeploy bug), I see no temp files left in /tmp After a clean run of "make test" I verified no stray files left in /tmp. And not seeing anything newer than nosetests.xml in the server-syncstorage tree.
Blocks: 740695
Duplicating the additional cleanup steps into sync1.1 codebase. Not really a backport as the sync2.0 version uses our new testing framework, but it should produce the same result.
Attachment #615249 - Flags: review?(telliott)
Attachment #615249 - Flags: review?(telliott) → review+
Let me know when this is ready (and set to Resolved/Fixed). I will check against an install of Sync 1.1 on qa1.
Attachment #615514 - Flags: review?(telliott)
I've also done similar changes for server-core and server-reg. With this in place, `make build` and `make test` for server-full should no longer leave stray tempfiles. This is good both for third-party installers and our lovely QA folks.
Attachment #615515 - Flags: review?(telliott)
Attachment #615514 - Flags: review?(telliott) → review+
Attachment #615515 - Flags: review?(telliott) → review+
http://hg.mozilla.org/services/server-reg/rev/5efc3c7c37ff http://hg.mozilla.org/services/server-reg/rev/5efc3c7c37ff The default `make build` for server-full builds things off the production channel, so it won't pick up these changes straight away. The following, however, should run without leaving behind any tempfiles: make build CHANNEL=dev make test
OK. I can verify this on qa1, sync 1.1 using the channel param.
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
OK, so I backed up the current server-full. I deleted leftover files in /tmp: the .db files and the one .log file Did the usual install process, with this change: $ make build CHANNEL=dev see this in STDOUT: ...etc... Cleaning up... bin/buildapp -c dev -i http://pypi.python.org/simple server-core,server-reg,server-storage The current channel is dev. Building the app ...etc... Run make test $ make test bin/nosetests -s --with-xunit deps/server-core/services/tests deps/server-reg/syncreg/tests deps/server-storage/syncstorage/tests ...............................................................................S.S..S........................./opt/sync/server-full/deps/server-reg/syncreg/tests/functional/support.py:92: DeprecationWarning: Method SQLUser.delete_user should be passed a dict of credentials, not a raw password self.auth.delete_user(self.user, self.password) ./opt/sync/server-full/deps/server-reg/syncreg/controllers/user.py:259: DeprecationWarning: Method SQLUser.update_field should be passed a dict of credentials, not a raw password 'mail', email): ./opt/sync/server-full/deps/server-reg/syncreg/controllers/user.py:309: DeprecationWarning: Method SQLUser.update_password should be passed a dict of credentials, not a raw password new_password): ../opt/sync/server-full/deps/server-reg/syncreg/tests/functional/test_user.py:349: DeprecationWarning: Method SQLUser.delete_user should be passed a dict of credentials, not a raw password self.auth.delete_user(User(name), 'x' * 9) ./opt/sync/server-full/deps/server-reg/syncreg/controllers/user.py:403: DeprecationWarning: Method SQLUser.delete_user should be passed a dict of credentials, not a raw password res = self.auth.delete_user(request.user, request.user_password) ........./opt/sync/server-full/deps/server-reg/syncreg/tests/functional/test_user.py:537: DeprecationWarning: Method SQLUser.delete_user should be passed a dict of credentials, not a raw password self.auth.delete_user(User(name), 'x' * 9) ....................................................... ---------------------------------------------------------------------- Ran 179 tests in 53.882s OK (SKIP=3) First, there are no *.db or *.log files in /tmp, so that is fixed. Let me know if the above deprecation warnings and skipped tests are expected given my configuration which does use MySQL setup as shown in my server-full/etc/sync.conf file (rather than using the default sqlite3 config). I have user "mysql.user" with a password accessing the sync.db database.
The deprecation warnings are expected, and I get the same three skips on my machine due to missing libs or services. The skipped tests are: * testing the LDAP user backend * testing the SReg user backend * testing some mocked backend errors So I'm happy to declare this the expected output.
Awesome. Will roll back to Prod channel at some point on qa1. But, for now, calling this one Verified.
Status: RESOLVED → VERIFIED
Just re-re-confirmed that the backported fix to Sync 1.1 is not working correctly. Even with a Dev branch build and some specific RPM packages chosen, the following two .db files are still getting created in /tmp: /tmp/sync.db /tmp/test.db See the long-lasting pastebin of our IRC conversation for more information: http://jbonacci.pastebin.mozilla.org/1608388 STRs: $ hg clone https://hg.mozilla.org/services/server-full $ cd server-full $ make build CHANNEL=dev $ make build SERVER_STORAGE=rpm-1.10-2 SERVER_REG=rpm-1.0-1 SERVER_CORE=rpm-2.6-5 $ make test Gives two errors around this: ImportError: No module named emailer for syncreg and the two files in /tmp
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
I've made some fresh tags so that the fix gets pulled in by default. On my box, the following build and run without leaving any database files behind: Building on default (prod) channel: $ hg clone https://hg.mozilla.org/services/server-full $ cd server-full $ make build $ make test Building on the development channel: $ hg clone https://hg.mozilla.org/services/server-full $ cd server-full $ make build CHANNEL=dev $ make test To get this working with the deployed version of server-storage, we would also need to backport the changes into server-core 2.6 branch. Is it worthwhile to do so?
I don't think it's worthwhile. Assumption is that external people will be on the trunk, and we don't use sqlite or care about log file location all that much.
OK, marking this "resolved/as-fixed-as-we're-going-to-make-it".
Status: REOPENED → RESOLVED
Closed: 14 years ago13 years ago
Resolution: --- → FIXED
OK. I can mark this as Verified/Fixed Enough.
Status: RESOLVED → VERIFIED
Product: Cloud Services → Cloud Services Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: