danwent / Perspectives

Perspectives Firefox Extension
http://perspectives-project.org
66 stars 19 forks source link

Make test cases work again #129

Open ghost opened 10 years ago

ghost commented 10 years ago

The following tests fail for me (upstream HEAD):

daveschaefer commented 10 years ago

Hey @lambdor , thanks for creating a bug on this. It is somewhat of a known issue that these tests fail. We could perhaps mark them as "unimplemented" or "to implement" instead, so they are not confused with unit tests that are actually broken due to some changes in code.

These tests were added when I was fixing the 'observation backfil' bug on the notary server scanner - https://github.com/danwent/Perspectives-Server/issues/23 . Notaries used to fill in large gaps of time whenever they made an observation, which was not correct. Implementing the fix for server bug 23 meant that it is now possible for notaries to have gaps in their observations. I wrote many of the test cases in that function to ensure that the Perspectives client handled gaps correctly.

These currently failing tests that you mention - these are test cases noting what I considered to be correct client behaviour when I was testing gap-handling. I would like to investigate each of these behaviours and figure out whether the test is incorrect and should be changed, or whether the client behaviour needs to be changed.

For example: It looks like quorum durations are always calculated assuming that observations end at the current time, regardless of when they actually end.

e.g.:

So when calculating the quorum duration for the cert we do (curtime - 7 days ago + 1 second === 7 days). So we return a duration of 7 days, even though the cert has only been seen for 5 days.

In a discussion with @danwent , "the original mental model we had was that if notary's most recent observation was for X, and the notary observation is not stale, then we consider that to be the notary's CURRENT (i.e., right now) notion of what the key is, hence the use of unixtime. If the code would still do this if there was another more recent notary observation for a different key, or if the key is stale, then I would say it is definitely a bug. Otherwise, I guess its more of a judgement call about exactly what we mean by quorum duration, in which case I believe the code matches what we proposed on the paper."

What do you think? Bug, or incorrect test?

ghost commented 10 years ago

Please also take a look at #137 - Ambigious quorum duration issues