Skip to content

fix #1219 convert v2 time offsets to sr3 correctly #1774

fix #1219 convert v2 time offsets to sr3 correctly

fix #1219 convert v2 time offsets to sr3 correctly #1774

GitHub Actions / Test Results failed Sep 18, 2024 in 0s

1 fail, 1 skipped, 246 pass in 1m 27s

248 tests   246 ✅  1m 27s ⏱️
  1 suites    1 💤
  1 files      1 ❌

Results for commit 6673508.

Annotations

Check warning on line 0 in sarracenia.interruptible_sleep_test

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_interruptible_sleep (sarracenia.interruptible_sleep_test) failed

tests/junit/test-results.xml [took 20s]
Raw output
assert 10 == 5
 +  where 10 = (datetime.datetime(2024, 9, 18, 20, 56, 16, 173515) - datetime.datetime(2024, 9, 18, 20, 56, 6, 165681)).seconds
def test_interruptible_sleep():
        st = SleepThing()
        stime = 10
    
        # Test that sleep sleeps for the right amount of time when not interrupted
        before_time = datetime.datetime.now()
        result = interruptible_sleep(stime, st)
        after_time = datetime.datetime.now()
        assert (result == False)
        assert ( (after_time - before_time).seconds == stime)
    
        # Test that the sleep behaves correctly when interrupted
        # send a SIGINT to this process after 5 seconds:
        cmdline = f"""bash -c '/usr/bin/sleep 5; kill -SIGTERM {os.getpid()};' &"""
        subprocess.run(cmdline, shell=True)
        before_time = datetime.datetime.now()
        result = interruptible_sleep(stime, st)
        after_time = datetime.datetime.now()
        assert result
>       assert ( (after_time - before_time).seconds == 5)
E       assert 10 == 5
E        +  where 10 = (datetime.datetime(2024, 9, 18, 20, 56, 16, 173515) - datetime.datetime(2024, 9, 18, 20, 56, 6, 165681)).seconds

tests/sarracenia/interruptible_sleep_test.py:41: AssertionError