After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 563319 - Sudoku timer completion is really off
Sudoku timer completion is really off
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: gnome-sudoku
2.24.x
Other All
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-05 07:58 UTC by Anthony Borrow
Modified: 2010-04-06 19:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
here I am starting the puzzle (see time) (108.50 KB, image/png)
2008-12-05 08:00 UTC, Anthony Borrow
  Details
here is a screenshot immediately at the beginning of the game (notice start time) (80.69 KB, image/png)
2008-12-05 08:02 UTC, Anthony Borrow
  Details
here is a screenshot at the end of the game (notice descrepancy in time) (119.58 KB, image/png)
2008-12-05 08:04 UTC, Anthony Borrow
  Details
test-timer.patch (2.37 KB, patch)
2009-04-08 14:29 UTC, Jesse Zhang
none Details | Review
reorganize timer code (7.51 KB, patch)
2009-04-09 02:51 UTC, Jesse Zhang
committed Details | Review
v2.26.0 finished game file w/ bad time (639 bytes, text/plain)
2009-04-10 05:51 UTC, Karl Norby
  Details
v2.26.0 finished game file w/ bad time (2) (640 bytes, text/plain)
2009-04-10 05:52 UTC, Karl Norby
  Details

Description Anthony Borrow 2008-12-05 07:58:54 UTC
Please describe the problem:
I start a new puzzle (hard) and complete the puzzle in about 18 minutes and it reports that it took several hours.

Steps to reproduce:
1. Start a new hard puzzle
2. Complete the puzzle
3. View the completion time and compare to time elapsed between 1&2


Actual results:
I have screen shots demonstrating what happens.

Expected results:
I would expect the time to be the same (or at least close) to the actual elapsed time.

Does this happen every time?
Yes

Other information:
Comment 1 Anthony Borrow 2008-12-05 08:00:29 UTC
Created attachment 123981 [details]
here I am starting the puzzle (see time)
Comment 2 Anthony Borrow 2008-12-05 08:02:08 UTC
Created attachment 123982 [details]
here is a screenshot immediately at the beginning of the game (notice start time)
Comment 3 Anthony Borrow 2008-12-05 08:04:48 UTC
Created attachment 123983 [details]
here is a screenshot at the end of the game (notice descrepancy in time)

About 18 minutes elapsed on my system clock and in the rest of the universe; however, Sudoku reports that 7 hours and 44 minutes have elapsed. I only noticed this after upgrading from Ubuntu 8.04 to 8.10. Any ideas for the discrepancy?
Comment 4 Thomas Andersen 2008-12-05 10:13:20 UTC
Hi Anthony

can you tell me the exact version of gnome-sudoku? We fixed some timer related bugs in 2.24.1.1. It could possibly be related to a game being started with version 2.24.1
Comment 5 Anthony Borrow 2008-12-05 15:52:41 UTC
Thomas - Yep, I am using 2.24.1 - I suspect you have it fixed and it just needs to work its way into the Debian and Ubuntu trees. If I get a chance, I'll download the latest version and see if the problem is still there. If it is possible to re-open bugs, I would go ahead and mark this as fixed and if it really is a continuing problem I will request that it be re-opened. Thanks for all you do for open source! Peace - Anthony
Comment 6 Karl Norby 2009-04-08 05:41:36 UTC
(In reply to comment #4)
> Hi Anthony
> 
> can you tell me the exact version of gnome-sudoku? We fixed some timer related
> bugs in 2.24.1.1. It could possibly be related to a game being started with
> version 2.24.1
> 

I am experiencing the same problem with 2.26.0, on Ubuntu 9.04. The time discrepancy in on the order of minutes instead of hours for me, but the problem is essentially the same.   
Comment 7 Thomas Andersen 2009-04-08 08:46:10 UTC
Thanks for testing this on 2.26.

One thing that could be a big help would be if you are able to attach the game file for the finished game. It could help us narrow down if the problem is in displaying/formating the time or the actual time "counting".

You can find the game files for the finished games in ~/.sudoku/finished
The filename will be a list of the numbers from the sudoku starting top left and going right.

Please attach a screenshot of the dialog where the wrong time is shown as well. Also a rough estimate of the time it really took to finish the game.
Comment 8 Jesse Zhang 2009-04-08 14:29:46 UTC
Created attachment 132342 [details] [review]
test-timer.patch

I think the problem is in toggle_timing,
    self.tot_time_complete += end_time - self.__absolute_start_time__
It should be '=', instead of '+='.

The patch contains several print statement. Use the following trick to test:
1.First wait for about 10 secs.
2.Press 'Minimize Window' on the right up corner (don't use panel's window-list or Alt+F9) and then resume it. Repeat several times and you will see tot_time_complete is increased rapidly.
Comment 9 Jesse Zhang 2009-04-09 02:51:36 UTC
Created attachment 132382 [details] [review]
reorganize timer code

tot_time => active_time
tot_time_complete => self.total_time

Also tried to keep compatibility with old saved game.
Comment 10 Karl Norby 2009-04-10 05:51:25 UTC
Created attachment 132449 [details]
v2.26.0 finished game file w/ bad time
Comment 11 Karl Norby 2009-04-10 05:52:42 UTC
Created attachment 132450 [details]
v2.26.0 finished game file w/ bad time (2)
Comment 12 Karl Norby 2009-04-10 05:59:49 UTC
(In reply to comment #7)
> Thanks for testing this on 2.26.
> 
> One thing that could be a big help would be if you are able to attach the game
> file for the finished game. It could help us narrow down if the problem is in
> displaying/formating the time or the actual time "counting".
> 
> You can find the game files for the finished games in ~/.sudoku/finished
> The filename will be a list of the numbers from the sudoku starting top left
> and going right.

Uploaded.

> Please attach a screenshot of the dialog where the wrong time is shown as well.
> Also a rough estimate of the time it really took to finish the game.

I can't seem to reproduce the bug now, with no change in my steps, so I haven't included a screenshot. On the two finished game files I attached, the actual time it took me to play (in wall clock time) was around 15 minutes, which was about the same as the reported actual time.

Comment 13 Thomas Andersen 2009-04-10 22:24:53 UTC
Committed to trunk with small update. Thanks a ton Zhang. The code is a lot more clean now.

http://svn.gnome.org/viewvc/gnome-games?view=revision&revision=9034
Comment 14 Thomas Andersen 2010-04-06 19:00:33 UTC
Closing as this should be fixed with the latest timer code fixes.

Please reopen if the problem still appears in version 2.31.1