{"action":"created","issue":{"url":"https://api.github.com/repos/jmmv/kyua/issues/155","repository_url":"https://api.github.com/repos/jmmv/kyua","labels_url":"https://api.github.com/repos/jmmv/kyua/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/jmmv/kyua/issues/155/comments","events_url":"https://api.github.com/repos/jmmv/kyua/issues/155/events","html_url":"https://github.com/jmmv/kyua/issues/155","id":132024688,"number":155,"title":"negative datetime::delta exception","user":{"login":"brooksdavis","id":3629693,"avatar_url":"https://avatars.githubusercontent.com/u/3629693?v=3","gravatar_id":"","url":"https://api.github.com/users/brooksdavis","html_url":"https://github.com/brooksdavis","followers_url":"https://api.github.com/users/brooksdavis/followers","following_url":"https://api.github.com/users/brooksdavis/following{/other_user}","gists_url":"https://api.github.com/users/brooksdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/brooksdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brooksdavis/subscriptions","organizations_url":"https://api.github.com/users/brooksdavis/orgs","repos_url":"https://api.github.com/users/brooksdavis/repos","events_url":"https://api.github.com/users/brooksdavis/events{/privacy}","received_events_url":"https://api.github.com/users/brooksdavis/received_events","type":"User","site_admin":false},"labels":[{"id":80881159,"url":"https://api.github.com/repos/jmmv/kyua/labels/invalid","name":"invalid","color":"e6e6e6","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2016-02-07T23:26:46Z","updated_at":"2016-11-15T22:09:47Z","closed_at":null,"body":"I've started trying to run the FreeBSD test suite on mips64 under qemu.  The run inevitably fails (after an indeterminate number of tests) with:\n\n```\nkyua: E: Cannot subtract 1454883115560690us from 1454883116245587us as it would result in a negative datetime::delta, which are not supported.\n```\n\nThe check in `datetime::timestamp::operator-` appears to be correct, but the exception string has the variables swapped.\n\nI'm using the `kyua-0.12,2` package.  The version of qemu is the amd64 version of `emulators/qemu-cheri`.  I can provide images if that would be useful.  I'll try to get this tested on real hardware as well to try and rule out a qemu bug.\n"},"comment":{"url":"https://api.github.com/repos/jmmv/kyua/issues/comments/260786027","html_url":"https://github.com/jmmv/kyua/issues/155#issuecomment-260786027","issue_url":"https://api.github.com/repos/jmmv/kyua/issues/155","id":260786027,"user":{"login":"jmmv","id":879272,"avatar_url":"https://avatars.githubusercontent.com/u/879272?v=3","gravatar_id":"","url":"https://api.github.com/users/jmmv","html_url":"https://github.com/jmmv","followers_url":"https://api.github.com/users/jmmv/followers","following_url":"https://api.github.com/users/jmmv/following{/other_user}","gists_url":"https://api.github.com/users/jmmv/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmv/subscriptions","organizations_url":"https://api.github.com/users/jmmv/orgs","repos_url":"https://api.github.com/users/jmmv/repos","events_url":"https://api.github.com/users/jmmv/events{/privacy}","received_events_url":"https://api.github.com/users/jmmv/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T22:09:47Z","updated_at":"2016-11-15T22:09:47Z","body":"So... I think the way we are tracking time in Kyua is broken. Time deltas are not going to work with the current timing mechanisms if the underlying time can change, and it can as you discovered.\r\n\r\nThe basic question is: what should happen if the current time changes while Kyua is running? Time deltas should work \"as you expect\", but what about timestamps? Should the \"end time\" of the run be allowed to be before the \"start time\", for example?\r\n\r\nI had two different thoughts:\r\n\r\n* Make each timestamp object carry the current real time and the monotonic time. Use the former to display timestamps, and the later to compute deltas. This is \"hard\" to do, would result in incompatible changes in the database, and may be quite confusing. (Timestamps shifting backwards without matching deltas.)\r\n\r\n* Use the real time clock to get the current timestamp the very first time we query the time, and store that as the internal view of what the \"base time\" is. Then, use the monotonic clock to compute deltas against that time and add them to the \"base time\" to calculate specific timestamps. This would require minimal changes I think. It's still a bit weird from the user's perspective, because if the time shifts back, the \"end time\" of the test run will be in the future. But at least it'd offer a consistent view of time throughout a test run.\r\n\r\nThere of course is the possibility of ignoring this altogether and truncating the timestamps, as your change proposes, but I fear this will not resolve other problems that may exist.\r\n\r\nThoughts?"}}
{"actor":{"display_login":"jmmv"}}