Skip to content

test_upload_dandiset_metadata: assert d.version.name == "shorty" #1314

Open
@yarikoptic

Description

@yarikoptic

upon release of dand-archive 0.2.53, CI integration testing in dandi-archive failed testing against released version of dandi-cli (which is odd since master is at release 0.46.4)

https://github.com/dandi/dandi-archive/actions/runs/3199087354/jobs/5224475301

________________________ test_upload_dandiset_metadata _________________________

new_dandiset = SampleDandiset(api=DandiAPI(api_key='e60f126ff4a8331b6149ff3bcdf87cc757cce935', client=<dandi.dandiapi.DandiAPIClient ...ndiset194'), dandiset=<dandi.dandiapi.RemoteDandiset object at 0x7ff76008ffa0>, dandiset_id='000199', upload_kwargs={})

    def test_upload_dandiset_metadata(new_dandiset: SampleDandiset) -> None:
        # For now let's "manually" populate dandiset.yaml in that downloaded location
        # which is missing due to https://github.com/dandi/dandi-api/issues/63
        d = new_dandiset.dandiset
        dspath = new_dandiset.dspath
        ds_orig = APIDandiset(dspath)
        ds_metadata = ds_orig.metadata
        assert ds_metadata is not None
        ds_metadata["description"] = "very long"
        ds_metadata["name"] = "shorty"
        (dspath / dandiset_metadata_file).write_text(yaml_dump(ds_metadata))
        new_dandiset.upload(
            paths=[dspath / dandiset_metadata_file], upload_dandiset_metadata=True
        )
        d.refresh()
>       assert d.version.name == "shorty"
E       AssertionError: assert 'Sample Dandi...iset_metadata' == 'shorty'
E         - shorty
E         + Sample Dandiset for test_upload_dandiset_metadata

which is odd... I searched into dandi/dandi-cli#1052 (comment) so we had exactly the same occasional failure before. Smells like some race condition in dandi-archive , but I want to confirm first before transferring this issue to dandi-archive since might be some bug in dandi-cli lazy properties etc. @jwodder WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsAdd or improve existing tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions