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 562782 - Incorrect elapsed playing time displayed
Incorrect elapsed playing time displayed
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
: 612369 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-11-30 17:56 UTC by Christopher Battles
Modified: 2010-04-10 10:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
image of endgame (13.86 KB, application/octet-stream)
2008-11-30 17:57 UTC, Christopher Battles
  Details
console output of gnome-sudoku -vp (75.93 KB, text/plain)
2008-11-30 17:58 UTC, Christopher Battles
  Details
Game file from .sudoku/finished/ (995 bytes, application/octet-stream)
2008-11-30 17:59 UTC, Christopher Battles
  Details
Patch to prevent auto-save from messing up the timer (1.36 KB, patch)
2010-03-25 06:11 UTC, Jim Ross
none Details | Review
Correct patch file (1.34 KB, patch)
2010-03-25 06:16 UTC, Jim Ross
none Details | Review
Patch to prevent auto-save from messing up the timer (1.70 KB, patch)
2010-03-26 02:41 UTC, Jim Ross
committed Details | Review
small fix to original patch (1.02 KB, patch)
2010-04-01 00:27 UTC, Jim Ross
committed Details | Review

Description Christopher Battles 2008-11-30 17:56:30 UTC
Please describe the problem:
This may be a duplicate of bug 556932.
Sudoku displays incorrect total elapsed time for game. 
Actual playing time was ~8min and is reported as 2hrs, 8minutes.
Test game on easy did not reproduce.  Reproduced multiple times when playing on "Very hard"

Steps to reproduce:
1. Play "Very Hard" game
2. Win
3. Pop-up displays incorrect elapsed time


Actual results:


Expected results:


Does this happen every time?
Yes

Other information:
Comment 1 Christopher Battles 2008-11-30 17:57:17 UTC
Created attachment 123699 [details]
image of endgame
Comment 2 Christopher Battles 2008-11-30 17:58:31 UTC
Created attachment 123700 [details]
console output of gnome-sudoku -vp

Note timestamp added before program launched and after termination
Comment 3 Christopher Battles 2008-11-30 17:59:19 UTC
Created attachment 123702 [details]
Game file from .sudoku/finished/
Comment 4 Christopher Battles 2008-11-30 18:02:03 UTC
uname -a
Linux Turing.cabent.org 2.6.27.5-117.fc10.i686 #1 SMP Tue Nov 18 12:19:59 EST 2008 i686 athlon i386 GNU/Linux

Comment 5 garywk 2009-12-28 20:07:47 UTC
I am affected by this bug too, but only after upgrading to 2.28.  In my case after upgrading the reported times, unless I close a game in progress and come back to it later, are under 1 minute the vast majority of the time.  It doesn't matter as to the level of difficulty of the game either.  It reports 57 or 58 seconds about 90% of the time whether the puzzle has taken me 6 minutes or 35 minutes to complete.

I run Debian Squeeze.
Comment 6 Jim Ross 2010-03-25 06:11:36 UTC
Created attachment 157031 [details] [review]
Patch to prevent auto-save from messing up the timer

Looks like auto save is the culprit.  The timer gets stopped when creating the save file.

This patch fixes the problem by adding a new method ActiveTimer.mark_timing() that takes the time snapshot without stopping the timer.  It also modifies jar_game() to use mark_timing() instead of finish_timing().
Comment 7 Jim Ross 2010-03-25 06:16:59 UTC
Created attachment 157032 [details] [review]
Correct patch file

oops.  I left a simple_debug in that last patch.  This one is ok.
Comment 8 Thomas Andersen 2010-03-25 22:34:40 UTC
Also awesome :)

I'd like to test the patch for a few days. If it fixes the problem we should get this in for 2.30.1. I know a lot of people would like to see this confusing bug go away.

Christopher, garywk, if you guys could help test the patch I would be very grateful.

Jim, you rock!
Comment 9 Jim Ross 2010-03-26 02:41:24 UTC
Created attachment 157139 [details] [review]
Patch to prevent auto-save from messing up the timer

Thanks man.  Sorry the format of that patch isn't right I think.  Still new to git.  This new one is made from format-patch.
Comment 10 Jim Ross 2010-03-26 19:54:32 UTC
hmm.  After reading through the bug lists a bit more carefully, it seems as though there are a few bugs involving timing issues.  The thing is - my patch addresses the problem that garywk is having - not the one Christopher is having.

auto-save related bug reports(the one my patch fixes)
Bug 612369, Pietro is describing the problem as well a hint to a fix.
Bug 556932, Freddy has the auto-save problem and Andy Own actually created a patch.  His is a bit more involved than mine, looks like it modifies the save file format.

And then we have the kind of problem that Christopher is reporting.  I'm not exactly sure, but the work you committed for Zhang on 4/14/2009 may address this problem.  See Bug 563319 for that patch.  You can also see this type of ridiculously off times reported within Bug 556932 by Josiah, Anthony, and Felix as well.

But I'm pretty sure that garywk's problem in here, Bug 612369 in its entirety, and Freddy's problem in Bug 556932 are duplicates of each other....and my patch should fix it.  It looks like Andy's patch should fix it as well though I haven't tried it out.

The other problems, I dunno.  I haven't seen it happen.  Zhang may have more insight on whether his patch fixes those problems.  I'll keep an eye out, and if it does happen to me I'll run it down.
Comment 11 garywk 2010-03-28 04:15:13 UTC
(In reply to comment #7)
> Created an attachment (id=157032) [details] [review]
> Correct patch file
> 
> oops.  I left a simple_debug in that last patch.  This one is ok.

I have been using this patch for the timer.py and saver.py and it solves the issues I was having.
Comment 12 Thomas Andersen 2010-03-29 21:29:42 UTC
Comment on attachment 157139 [details] [review]
Patch to prevent auto-save from messing up the timer

Committed to master:
http://git.gnome.org/browse/gnome-games/commit/?id=ebddb026569a1b9035cb2ce551fc1c4827b9fa89

Thanks! :)
Comment 13 Thomas Andersen 2010-03-29 21:30:15 UTC
And thanks to garywk for testing too. Much appreciated.
Comment 14 Jim Ross 2010-03-30 04:43:30 UTC
Right on.
Comment 15 Jim Ross 2010-04-01 00:27:16 UTC
Created attachment 157653 [details] [review]
small fix to original patch

Sorry, I found a small problem with this.

It showed up while i was debugging the note editor timer(yeah, working on that one too).  The problem is, when the main window is not active(timer paused) and the auto-save kicks in - the timer always gets restarted in mark_timing().

This patch fixes it by storing the current value of self.is_timing at the start of mark_timing() and then checking it before calling resume_timing().
Comment 16 Thomas Andersen 2010-04-06 19:38:09 UTC
Comment on attachment 157653 [details] [review]
small fix to original patch

Committed on master:
http://git.gnome.org/browse/gnome-games/commit/?id=f235e03e98e960a69627f5b4afacb9f14d599bad

Thanks again Jim!

I added some of your explanation of the problem and fix to the commit. I also added a reference to this bug.
Comment 17 Thomas Andersen 2010-04-10 10:00:13 UTC
*** Bug 612369 has been marked as a duplicate of this bug. ***