Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK - Testing - Fix metadata comparison instability #2145

Conversation

Ark-kun
Copy link
Contributor

@Ark-kun Ark-kun commented Sep 17, 2019

After #2044 was merged the unit tests become flaky on Python 3.5 since the serialization of the dictionaries used in the default pipeline parameter values is not deterministic.
This PR fixes the root cause of the flakiness - the tests that were comparing the serialized metadata strings instead of the structures.


This change is Reviewable

@Ark-kun Ark-kun force-pushed the SDK---Testing---Fix-metadata-comparison-instability branch from 8973383 to 79ea63c Compare September 17, 2019 21:18
@Ark-kun
Copy link
Contributor Author

Ark-kun commented Sep 17, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ark-kun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Sep 17, 2019

/retest

@numerology
Copy link

/lgtm

@numerology
Copy link

QQ: is that possible to do something like assertDictEqual to compare the actual pipeline_spec?

@Ark-kun
Copy link
Contributor Author

Ark-kun commented Sep 17, 2019

QQ: is that possible to do something like assertDictEqual to compare the actual pipeline_spec?

I did something like that first - deserialized the spec into structure so that it's compared structurally. 42492d5 Unfortunately, the problem was deeper since the default values are also serialized, so there is another layer of serialization.

One solution would be to make the default value serialization stable by sorting all keys in the deep structure, but I'm still thinking whether this is a good idea.

@numerology
Copy link

QQ: is that possible to do something like assertDictEqual to compare the actual pipeline_spec?

I did something like that first - deserialized the spec into structure so that it's compared structurally. 42492d5 Unfortunately, the problem was deeper since the default values are also serialized, so there is another layer of serialization.

One solution would be to make the default value serialization stable by sorting all keys in the deep structure, but I'm still thinking whether this is a good idea.

Got it. We definitely need to fix this first.

@k8s-ci-robot k8s-ci-robot merged commit 642dd13 into kubeflow:master Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants