scylladb / python-driver

ScyllaDB Python Driver, originally DataStax Python Driver for Apache Cassandra
https://python-driver.docs.scylladb.com
Apache License 2.0
70 stars 42 forks source link

TimeUtilTest.test_uuid_from_time time to time fails on `windows-latest` #369

Open dkropachev opened 1 month ago

dkropachev commented 1 month ago

Happened here

  ================================== FAILURES ===================================
  ______________________ TimeUtilTest.test_uuid_from_time _______________________

  self = <tests.unit.test_time_util.TimeUtilTest testMethod=test_uuid_from_time>

      def test_uuid_from_time(self):
          t = time.time()
          seq = 0x2aa5
          node = uuid.getnode()
          u = util.uuid_from_time(t, node, seq)
          # using AlmostEqual because time precision is different for
          # some platforms
          self.assertAlmostEqual(util.unix_time_from_uuid1(u), t, 4)
          self.assertEqual(u.node, node)
          self.assertEqual(u.clock_seq, seq)

          # random node
          u1 = util.uuid_from_time(t, clock_seq=seq)
          u2 = util.uuid_from_time(t, clock_seq=seq)
          self.assertAlmostEqual(util.unix_time_from_uuid1(u1), t, 4)
          self.assertAlmostEqual(util.unix_time_from_uuid1(u2), t, 4)
          self.assertEqual(u.clock_seq, seq)
          # not impossible, but we shouldn't get the same value twice
          self.assertNotEqual(u1.node, u2.node)

          # random seq
          u1 = util.uuid_from_time(t, node=node)
          u2 = util.uuid_from_time(t, node=node)
          self.assertAlmostEqual(util.unix_time_from_uuid1(u1), t, 4)
          self.assertAlmostEqual(util.unix_time_from_uuid1(u2), t, 4)
          self.assertEqual(u.node, node)
          # not impossible, but we shouldn't get the same value twice
  >       self.assertNotEqual(u1.clock_seq, u2.clock_seq)
  E       AssertionError: 5422 == 5422

  D:\a\python-driver\python-driver\tests\unit\test_time_util.py:77: AssertionError