diff --git a/test/github/kv_test.rb b/test/github/kv_test.rb
index <HASH>..<HASH> 100644
--- a/test/github/kv_test.rb
+++ b/test/github/kv_test.rb
@@ -169,7 +169,9 @@ class GitHub::KVTest < Minitest::Test
   def test_ttl
     assert_nil @kv.ttl("foo-ttl").value!
 
-    expires = 1.hour.from_now
+    # the Time.at dance is necessary because MySQL does not support sub-second
+    # precision in DATETIME values
+    expires = Time.at(1.hour.from_now.to_i).utc
     @kv.set("foo-ttl", "bar", expires: expires)
 
     assert_equal expires, @kv.ttl("foo-ttl").value!
Fix test that was failing due to sub-second precision