GNOME Bugzilla – Bug 562782
Incorrect elapsed playing time displayed
Last modified: 2010-04-10 10:00:13 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:
Created attachment 123699 [details] image of endgame
Created attachment 123700 [details] console output of gnome-sudoku -vp Note timestamp added before program launched and after termination
Created attachment 123702 [details] Game file from .sudoku/finished/
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
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.
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().
Created attachment 157032 [details] [review] Correct patch file oops. I left a simple_debug in that last patch. This one is ok.
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!
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.
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.
(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 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! :)
And thanks to garywk for testing too. Much appreciated.
Right on.
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 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.
*** Bug 612369 has been marked as a duplicate of this bug. ***