Skip to content

Wrong content returned if a table is modified #237

Closed
@bouda1

Description

@bouda1

Hi,

Since robotframework-databaselibrary version 4.1.0, we have an issue.

We work with mariadb.

And here is an example of code we could use:

    Connect To Database    pymysql    ${DBNameConf}    ${DBUser}    ${DBPass}    ${DBHost}    ${DBPort}
    FOR    ${index}    IN RANGE    10                                           
        ${output}    Query    SELECT current_status, state_type FROM my_table WHERE parent_id=16 and id= 314
        Sleep    1s                                                             
        IF    ${output} == ((2, '1'),)    BREAK                                 
    END                                                                         
                                                                                
    Should Be Equal As Strings    ${output}    ((2, '1'),)    mod_bam_kpi not filled
    Disconnect From Database

We know that the query does not return the expected response immediately; we need to wait to get the correct one. Therefore, we have this loop to wait for approximately 10 seconds. Since version 4.1.0, if the output is incorrect the first time, it will remain incorrect in the following steps. This is because ${output} retains its initial value.

Currently, the solution I have is to change the code to this:

    FOR    ${index}    IN RANGE    10                                           
        Connect To Database    pymysql    ${DBNameConf}    ${DBUser}    ${DBPass}    ${DBHost}    ${DBPort}
        ${output}    Query    SELECT current_status, state_type FROM my_table WHERE parent_id=16 and id= 314
        Sleep    1s                                                             
        IF    ${output} == ((2, '1'),)    BREAK                                 
        Disconnect From Database
    END                                                                         
                                                                                
    Should Be Equal As Strings    ${output}    ((2, '1'),)    mod_bam_kpi not filled

Otherwise, I can also force the version 4.0.4 of your library.
Thanks.
Cheers.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions