[geary/wip/imap-db-acccount-test-flakey: 2/2] Add temp debug logging



commit 8d735b48d378cd9332169e0ca5a93e41de9ffa62
Author: Michael Gratton <mike vee net>
Date:   Mon Jan 21 15:23:55 2019 +1030

    Add temp debug logging

 test/engine/imap-db/imap-db-account-test.vala  | 11 +++++++++++
 test/engine/imap-db/imap-db-database-test.vala |  8 ++++++++
 2 files changed, 19 insertions(+)
---
diff --git a/test/engine/imap-db/imap-db-account-test.vala b/test/engine/imap-db/imap-db-account-test.vala
index c6aac242..398734f6 100644
--- a/test/engine/imap-db/imap-db-account-test.vala
+++ b/test/engine/imap-db/imap-db-account-test.vala
@@ -41,12 +41,14 @@ class Geary.ImapDB.AccountTest : TestCase {
         );
 
         this.account = new Account(config);
+        print("\n *** opening account\n");
         this.account.open_async.begin(
             this.tmp_dir,
             GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql"),
             null,
             (obj, ret) => { async_complete(ret); }
         );
+        print("*** waiting for account\n");
         this.account.open_async.end(async_result());
 
         this.root = new FolderRoot(false);
@@ -54,12 +56,15 @@ class Geary.ImapDB.AccountTest : TestCase {
 
     public override void tear_down() throws GLib.Error {
         this.root = null;
+        print("\n *** closing account\n");
         this.account.close_async.begin(
             null,
             (obj, ret) => { async_complete(ret); }
         );
+        print("*** waiting for account\n");
         this.account.close_async.end(async_result());
         this.account = null;
+        print("*** account closed\n");
 
         delete_file(this.tmp_dir);
         this.tmp_dir = null;
@@ -268,6 +273,7 @@ class Geary.ImapDB.AccountTest : TestCase {
     }
 
     public void fetch_child_folder() throws GLib.Error {
+        print("\n *** inserting data");
         this.account.db.exec("""
             INSERT INTO FolderTable (id, name, parent_id)
             VALUES
@@ -275,18 +281,21 @@ class Geary.ImapDB.AccountTest : TestCase {
                 (2, 'test2', 1);
         """);
 
+        print("*** fetching folder\n");
         this.account.fetch_folder_async.begin(
             this.root.get_child("test1").get_child("test2"),
             null,
             (obj, ret) => { async_complete(ret); }
         );
 
+        print("*** waiting for result\n");
         Folder? result = this.account.fetch_folder_async.end(async_result());
         assert_non_null(result);
         assert_string("test2", result.get_path().name);
     }
 
     public void fetch_nonexistent_folder() throws GLib.Error {
+        print("\n *** inserting data");
         this.account.db.exec("""
             INSERT INTO FolderTable (id, name, parent_id)
             VALUES
@@ -294,11 +303,13 @@ class Geary.ImapDB.AccountTest : TestCase {
                 (2, 'test2', 1);
         """);
 
+        print("*** fetching folder\n");
         this.account.fetch_folder_async.begin(
             this.root.get_child("test3"),
             null,
             (obj, ret) => { async_complete(ret); }
         );
+        print("*** waiting for result\n");
         try {
             this.account.fetch_folder_async.end(async_result());
             assert_not_reached();
diff --git a/test/engine/imap-db/imap-db-database-test.vala b/test/engine/imap-db/imap-db-database-test.vala
index 1f823d6b..d26ff71d 100644
--- a/test/engine/imap-db/imap-db-database-test.vala
+++ b/test/engine/imap-db/imap-db-database-test.vala
@@ -39,10 +39,12 @@ class Geary.ImapDB.DatabaseTest : TestCase {
             "test example com"
         );
 
+        print("\n*** opening database\n");
         db.open.begin(
             Geary.Db.DatabaseFlags.CREATE_FILE, null,
             (obj, ret) => { async_complete(ret); }
         );
+        print("*** waiting for database\n");
         db.open.end(async_result());
 
         // Need to get a connection since the database doesn't
@@ -50,7 +52,9 @@ class Geary.ImapDB.DatabaseTest : TestCase {
         db.get_master_connection();
 
         // Need to close it again to stop the GC process running
+        print("*** closing database\n");
         db.close();
+        print("*** database closed\n");
     }
 
     public void upgrade_0_6() throws Error {
@@ -100,10 +104,12 @@ class Geary.ImapDB.DatabaseTest : TestCase {
             "test example com"
         );
 
+        print("\n*** opening database\n");
         db.open.begin(
             Geary.Db.DatabaseFlags.CREATE_FILE, null,
             (obj, ret) => { async_complete(ret); }
         );
+        print("*** waiting for database\n");
         db.open.end(async_result());
 
         assert_int(25, db.get_schema_version(), "Post-upgrade version");
@@ -122,7 +128,9 @@ class Geary.ImapDB.DatabaseTest : TestCase {
 
 
         // Need to close it again to stop the GC process running
+        print("*** closing database\n");
         db.close();
+        print("*** database closed\n");
     }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]