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

fix: assert condition command timeout parsing #2171

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

rwtnb
Copy link
Contributor

@rwtnb rwtnb commented Dec 3, 2024

Proposed changes

Removing private access modifier from timeout field

Issues fixed

Private modifier on timeout field is preventing the field to be populated on deserialization.

@@ -372,7 +372,7 @@ data class AssertCommand(

data class AssertConditionCommand(
val condition: Condition,
private val timeout: String? = null,
val timeout: String? = null,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too sure how changing scope of variable fixes the issue?

Can you write a test for it as well, so that it not breaks again?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no sure how this test would look, since it happens only on Robin. I can add a the test there two if you want

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too sure how changing scope of variable fixes the issue?

Can you write a test for it as well, so that it not breaks again?

private variables don't get filled out by json parsing. If this is being parsed (it seems to be the case), it'll always be null

Copy link
Collaborator

@amanjeetsingh150 amanjeetsingh150 Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel I might be missing something, the deserialization of Yaml commands to Maestro commands works through same deserializer here in YamlCommandReader for both Robin and CLI.

If it's working on CLI and not on Robin, it sounds like we must be doing something wrong on Robin. Not sure it's clear from here what.

Copy link
Contributor

@felipeduartea felipeduartea Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seams ot me that this is due to some library version that doesn't parse the json of private variables anymore, as the code implementations is the same in both codes. Still figuring out which one is it. Should I proceed with the release or wait till this is figured out?

I think it probably makes sense to release it that way, since the condition variable already is not private, btw do you have context on that? @amanjeetsingh150

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can go ahead with the release no worries!

But since that can be an issue with private variables. I think more importantly let's ensure there are no other private variables in maestro commands that could also face this issue.

On the version thing probably it makes sense to confirm that we are using same version of serialzers for robin for jackson or some dependency is not missing?

Copy link
Contributor

@felipeduartea felipeduartea Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But since that can be an issue with private variables. I think more importantly let's ensure there are no other private variables in maestro commands that could also face this issue.

Checked this, it seems that this was the last private val that we had on the MaestroCommand

On the version thing probably it makes sense to confirm that we are using same version of serialzers for robin for jackson or some dependency is not missing?

Also think that it's something related to this, will take a look as soon as I free up

@Fishbowler Fishbowler force-pushed the fix/extended-wait-timeout branch from 7bed304 to 5e21eb3 Compare December 4, 2024 11:44
@Fishbowler
Copy link
Contributor

Rebased

@Fishbowler
Copy link
Contributor

How do you reproduce the problem?

@Fishbowler
Copy link
Contributor

Locally, I tried (using the release version):

appId: com.example.example
---
- launchApp
- extendedWaitUntil:
    visible: "2"
    timeout: 60000

Which times out after 60s, as it should.

Is the serialisation problem only a problem for Robin?

@felipeduartea
Copy link
Contributor

Is the serialisation problem only a problem for Robin?

Yeah, this issue only happens in Robin serialization, since the timeout var is private. I created 3 .yaml files and tested them on Robin. They were all failling before and not recognizing the timeout, but with the change this is not happening anymore.

Copy link
Collaborator

@herval herval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably review all the commands to see which ones have private vals and make them public, since this might be leading to other issues we're not seeing yet

@felipeduartea felipeduartea merged commit 3099bc7 into main Dec 13, 2024
7 of 8 checks passed
@felipeduartea felipeduartea deleted the fix/extended-wait-timeout branch December 13, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants