While contributing to ZHF I experienced some general issues that some python packages fail only on hydra x86_64_darwin but work on x86_64_linux:
In this particular case hydra seems to have problems with the following test only on darwin:
fs = <fsspec.implementations.local.LocalFileSystem object at 0x10c00f190>
temp_file = '/private/tmp/nix-build-python3.8-fsspec-0.7.4.drv-0/tmpsupgb68itest-file'
@pytest.mark.parametrize("fs", ["local"], indirect=["fs"])
def test_modified(fs: AbstractFileSystem, temp_file):
try:
fs.touch(temp_file)
created = fs.created(path=temp_file)
time.sleep(0.05)
fs.touch(temp_file)
modified = fs.modified(path=temp_file)
assert isinstance(modified, datetime.datetime)
> assert modified > created
E assert datetime.datetime(2020, 9, 10, 19, 8, 22) > datetime.datetime(2020, 9, 10, 19, 8, 22)
fsspec/implementations/tests/test_common.py:29: AssertionError
Strange. Why does it have problems comparing timestamps? Anyway next step is to test it locally. Unfortunately all the tests pass on my machine (OSX 10.15).
So what to do now? It works locally on darwin and on hydra linux but fails with a only-reproducible error on hydra darwin.
In this case the usual approach is to just disable the one failing test on darwin so that hydra darwin passes. With the new pytestCheckHook
this can be done in a pretty elegant way as can be seen in this accepted pull request.
I then backported this change into 20.09 only to see that now another test case fails on hydra darwin only. (a new test case because I also bumped the version which had additional tests).
So now the game begins again:
- disable test on darwin
- wait until reviewed
- see if it builds on hydra
So long story short: Can I somehow test darwin builds on hydra locally to get faster feedback? Is there a possibility to optimise this workflow? And finally: Can somebody explain why the test_modified
actually failed on hydra?