Skip to content

Commit 97de9b6

Browse files
committed
fix: update tests to ensure we are not relying on time drift for the test to pass
1 parent 57b5b0a commit 97de9b6

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/test_history.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ def test_question_suppression():
4747
def test_question_expire():
4848
history = QuestionHistory()
4949

50-
question = r.DNSQuestion("_hap._tcp._local.", const._TYPE_PTR, const._CLASS_IN)
5150
now = r.current_time_millis()
51+
question = r.DNSQuestion("_hap._tcp._local.", const._TYPE_PTR, const._CLASS_IN)
5252
other_known_answers: Set[r.DNSRecord] = {
5353
r.DNSPointer(
54-
"_hap._tcp.local.", const._TYPE_PTR, const._CLASS_IN, 10000, 'known-to-other._hap._tcp.local.'
54+
"_hap._tcp.local.",
55+
const._TYPE_PTR,
56+
const._CLASS_IN,
57+
10000,
58+
'known-to-other._hap._tcp.local.',
59+
created=now,
5560
)
5661
}
5762
history.add_question_at_time(question, now, other_known_answers)

0 commit comments

Comments
 (0)