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

Folder contents does not always load. Robot tests broken. #3542

Closed
mauritsvanrees opened this issue May 23, 2022 · 6 comments
Closed

Folder contents does not always load. Robot tests broken. #3542

mauritsvanrees opened this issue May 23, 2022 · 6 comments

Comments

@mauritsvanrees
Copy link
Member

  • Plone coredev 6, Python 3.10
  • Create a Classic Plone site.
  • Add a few items in the root, say a Page and a Folder.
  • Go to the folder contents of the root.
  • Reload the page a few times.

Problem: sometimes this works, sometimes not.
When it does not work, you only see the title, the document byline, and the overal page structure (header, footer, toolbar). In case it helps, the content-core looks like this:

<div id="content-core">
                
    
        <input type="hidden" name="_authenticator" value="e0cdd74ee0d82f0afdff52b429f73fee3b8b270c">
        <div class="pat-structure" data-pat-structure="{&quot;vocabularyUrl&quot;: &quot;http://localhost:8080/Plone2/@@getVocabulary?name=plone.app.vocabularies.Catalog&quot;, &quot;urlStructure&quot;: {&quot;base&quot;: &quot;http://localhost:8080/Plone2&quot;, &quot;appended&quot;: &quot;/folder_contents&quot;}, &quot;moveUrl&quot;: &quot;http://localhost:8080/Plone2{path}/fc-itemOrder&quot;, &quot;indexOptionsUrl&quot;: &quot;http://localhost:8080/Plone2/@@qsOptions&quot;, &quot;contextInfoUrl&quot;: &quot;http://localhost:8080/Plone2{path}/@@fc-contextInfo&quot;, &quot;setDefaultPageUrl&quot;: &quot;http://localhost:8080/Plone2{path}/@@fc-setDefaultPage&quot;, &quot;defaultPageTypes&quot;: [&quot;Document&quot;, &quot;Event&quot;, &quot;News Item&quot;, &quot;Collection&quot;], &quot;searchParam&quot;: &quot;Title&quot;, &quot;availableColumns&quot;: {&quot;CreationDate&quot;: &quot;Created on&quot;, &quot;Creator&quot;: &quot;Creator&quot;, &quot;Description&quot;: &quot;Description&quot;, &quot;EffectiveDate&quot;: &quot;Publication date&quot;, &quot;ExpirationDate&quot;: &quot;Expiration date&quot;, &quot;ModificationDate&quot;: &quot;Last modified&quot;, &quot;Subject&quot;: &quot;Tags&quot;, &quot;Type&quot;: &quot;Type&quot;, &quot;UID&quot;: &quot;UID&quot;, &quot;end&quot;: &quot;End Date&quot;, &quot;exclude_from_nav&quot;: &quot;Excluded from navigation&quot;, &quot;getObjSize&quot;: &quot;Object Size&quot;, &quot;id&quot;: &quot;ID&quot;, &quot;is_folderish&quot;: &quot;Folder&quot;, &quot;location&quot;: &quot;Location&quot;, &quot;review_state&quot;: &quot;Review state&quot;, &quot;start&quot;: &quot;Start Date&quot;, &quot;mime_type&quot;: &quot;MIME type&quot;, &quot;total_comments&quot;: &quot;Total comments&quot;, &quot;last_comment_date&quot;: &quot;Last comment date&quot;}, &quot;attributes&quot;: [&quot;Title&quot;, &quot;path&quot;, &quot;getURL&quot;, &quot;getIcon&quot;, &quot;getMimeIcon&quot;, &quot;portal_type&quot;, &quot;CreationDate&quot;, &quot;Creator&quot;, &quot;Description&quot;, &quot;EffectiveDate&quot;, &quot;ExpirationDate&quot;, &quot;ModificationDate&quot;, &quot;Subject&quot;, &quot;Type&quot;, &quot;UID&quot;, &quot;end&quot;, &quot;exclude_from_nav&quot;, &quot;getObjSize&quot;, &quot;id&quot;, &quot;is_folderish&quot;, &quot;location&quot;, &quot;review_state&quot;, &quot;start&quot;, &quot;mime_type&quot;, &quot;total_comments&quot;, &quot;last_comment_date&quot;], &quot;buttons&quot;: [{&quot;tooltip&quot;: &quot;Cut&quot;, &quot;id&quot;: &quot;cut&quot;, &quot;icon&quot;: &quot;plone-cut&quot;, &quot;url&quot;: &quot;http://localhost:8080/Plone2/@@fc-cut&quot;}, {&quot;tooltip&quot;: &quot;Copy&quot;, &quot;id&quot;: &quot;copy&quot;, &quot;icon&quot;: &quot;plone-copy&quot;, &quot;url&quot;: &quot;http://localhost:8080/Plone2/@@fc-copy&quot;}, {&quot;tooltip&quot;: &quot;Paste&quot;, &quot;id&quot;: &quot;paste&quot;, &quot;icon&quot;: &quot;plone-paste&quot;, &quot;url&quot;: &quot;http://localhost:8080/Plone2/@@fc-paste&quot;}, {&quot;tooltip&quot;: &quot;Delete&quot;, &quot;id&quot;: &quot;delete&quot;, &quot;icon&quot;: &quot;plone-delete&quot;, &quot;context&quot;: &quot;danger&quot;, &quot;url&quot;: &quot;http://localhost:8080/Plone2/@@fc-delete&quot;, &quot;form&quot;: {&quot;title&quot;: &quot;Delete selected items&quot;, &quot;submitText&quot;: &quot;Yes&quot;, &quot;submitContext&quot;: &quot;danger&quot;, &quot;template&quot;: &quot;<div>\n  <% try{ %>\n    <%= data.html || '' %>\n  <% }catch(e){} %>\n  <label>Are you certain you want to delete the selected items?</label>\n</div>&quot;, &quot;closeText&quot;: &quot;No&quot;, &quot;dataUrl&quot;: &quot;http://localhost:8080/Plone2/@@fc-delete&quot;}}, {&quot;tooltip&quot;: &quot;Rename&quot;, &quot;id&quot;: &quot;rename&quot;, &quot;icon&quot;: &quot;plone-rename&quot;, &quot;url&quot;: &quot;http://localhost:8080/Plone2/@@fc-rename&quot;, &quot;form&quot;: {&quot;title&quot;: &quot;Rename&quot;, &quot;template&quot;: &quot;<div class=\&quot;itemstoremove\&quot;>\n<% _.each(items, function(item, index) { %>\n  <div class=\&quot;item\&quot;>\n\n    <div class=\&quot;form-group\&quot;>\n      <input name=\&quot;UID_<%= index %>\&quot; type=\&quot;hidden\&quot; value=\&quot;<%- item.UID %>\&quot; />\n      <label>Title</label>\n      <input class=\&quot;form-control\&quot; name=\&quot;newtitle_<%= index %>\&quot; value=\&quot;<%= item.Title %>\&quot; />\n      <label>Short name</label>\n      <input class=\&quot;form-control\&quot; name=\&quot;newid_<%= index %>\&quot; value=\&quot;<%= item.id %>\&quot; />\n    </div>\n\n    <% if(item.getIcon ){ %><img class=\&quot;thumb-thumb\&quot; src=\&quot;<%= item.getURL %>/@@images/image/thumb\&quot;><% } %>\n\n  </div>\n<% }) %>\n</div>\n&quot;}}, {&quot;tooltip&quot;: &quot;Tags&quot;, &quot;id&quot;: &quot;tags&quot;, &quot;icon&quot;: &quot;tags&quot;, &quot;url&quot;: &quot;http://localhost:8080/Plone2/@@fc-tags&quot;, &quot;form&quot;: {&quot;title&quot;: &quot;Tags&quot;, &quot;template&quot;: &quot;<div>\n  <label>Tags to remove</label>\n  <div class=\&quot;form-group\&quot;>\n    <select multiple class=\&quot;toremove pat-select2\&quot; name=\&quot;toremove\&quot; style=\&quot;width: 300px\&quot;>\n      <% var tags = [];\n      _.each(items, function(item, index) {\n        _.each(item.Subject, function(tag) {\n          if(tags.indexOf(tag) === -1){\n            tags.push(tag);\n            %><option value=\&quot;<%= tag %>\&quot;><%= tag %></option>\n            <%\n          }\n        });\n      }); %>\n    </select>\n  </div>\n  <label>Tags to add</label>\n  <div class=\&quot;form-group\&quot;>\n    <input class=\&quot;toadd pat-select2\&quot; style=\&quot;width:300px\&quot; name=\&quot;toadd\&quot; data-pat-select2=\&quot;multiple: true; vocabularyUrl: http://localhost:8080/Plone2/@@getVocabulary?name=plone.app.vocabularies.Keywords\&quot;/>\n  </div>\n</div>&quot;}}, {&quot;tooltip&quot;: &quot;State&quot;, &quot;id&quot;: &quot;workflow&quot;, &quot;icon&quot;: &quot;plone-lock&quot;, &quot;url&quot;: &quot;http://localhost:8080/Plone2/@@fc-workflow&quot;, &quot;form&quot;: {&quot;title&quot;: &quot;Change workflow of selected items&quot;, &quot;template&quot;: &quot;<fieldset>\n  <div class=\&quot;form-group\&quot;>\n    <label>Comments</label>\n    <textarea class=\&quot;form-control\&quot; rows=\&quot;2\&quot; name=\&quot;comments\&quot;></textarea>\n  </div>\n  <div class=\&quot;form-group\&quot;>\n    <label>Change State</label>\n    <p class=\&quot;help-block\&quot;>Select the transition to be used for modifying the items state.</p>\n    <select class=\&quot;form-control\&quot; name=\&quot;transition\&quot;>\n      <% if(data.transitions){\n        _.each(data.transitions, function(transition){\n          %><option value=\&quot;<%= transition.id %>\&quot;><%= transition.title %></option>\n          <%\n        });\n      } %>\n    </select>\n  </div>\n  <div class=\&quot;checkbox\&quot;>\n    <label>\n      <input type=\&quot;checkbox\&quot; name=\&quot;recurse\&quot; value=\&quot;yes\&quot; />\n      <span>Include contained items</span>\n    </label>\n    <p class=\&quot;help-block\&quot;>If checked, this will attempt to modify the status of all content in any selected folders and their subfolders.</p>\n  </div>\n</fieldset>&quot;, &quot;dataUrl&quot;: &quot;http://localhost:8080/Plone2/@@fc-workflow&quot;}}, {&quot;tooltip&quot;: &quot;Properties&quot;, &quot;id&quot;: &quot;properties&quot;, &quot;icon&quot;: &quot;plone-edit&quot;, &quot;url&quot;: &quot;http://localhost:8080/Plone2/@@fc-properties&quot;, &quot;form&quot;: {&quot;title&quot;: &quot;Modify properties on items&quot;, &quot;template&quot;: &quot;<div>\n\n  <div class=\&quot;form-group\&quot;>\n    <label>Publication Date</label>\n    <input class=\&quot;form-control pat-date-picker\&quot; name=\&quot;effectiveDate\&quot; data-pat-date-picker=\&quot;{&amp;quot;behavior&amp;quot;: &amp;quot;native&amp;quot;, &amp;quot;week-numbers&amp;quot;: &amp;quot;show&amp;quot;, &amp;quot;first-day&amp;quot;: 0, &amp;quot;today&amp;quot;: &amp;quot;Today&amp;quot;, &amp;quot;clear&amp;quot;: &amp;quot;Clear&amp;quot;}\&quot;/>\n  </div>\n\n  <div class=\&quot;form-group\&quot;>\n    <label>Expiration Date</label>\n    <input class=\&quot;form-control pat-date-picker\&quot; name=\&quot;expirationDate\&quot; data-pat-date-picker=\&quot;{&amp;quot;behavior&amp;quot;: &amp;quot;native&amp;quot;, &amp;quot;week-numbers&amp;quot;: &amp;quot;show&amp;quot;, &amp;quot;first-day&amp;quot;: 0, &amp;quot;today&amp;quot;: &amp;quot;Today&amp;quot;, &amp;quot;clear&amp;quot;: &amp;quot;Clear&amp;quot;}\&quot;/>\n  </div>\n\n  <div class=\&quot;form-group\&quot;>\n    <label>Copyright</label>\n    <textarea class=\&quot;form-control\&quot; name=\&quot;copyright\&quot;></textarea>\n  </div>\n\n  <label>Creators</label>\n  <div class=\&quot;form-group\&quot;>\n    <input name=\&quot;creators\&quot; style=\&quot;width: 300px\&quot; class=\&quot;pat-select2\&quot; data-pat-select2=\&quot;multiple: true;\n                             vocabularyUrl: http://localhost:8080/Plone2/@@getVocabulary?name=plone.app.vocabularies.Users\&quot;/>\n  </div>\n\n  <label>Contributors</label>\n  <div class=\&quot;form-group\&quot;>\n    <input name=\&quot;contributors\&quot; style=\&quot;width: 300px\&quot; class=\&quot;pat-select2\&quot; data-pat-select2=\&quot;multiple: true;\n                             vocabularyUrl: http://localhost:8080/Plone2/@@getVocabulary?name=plone.app.vocabularies.Users\&quot;/>\n  </div>\n\n  <label>Exclude from navigation</label>\n  <div class=\&quot;radio\&quot;>\n    <label>\n      <input type=\&quot;radio\&quot; name=\&quot;exclude-from-nav\&quot; value=\&quot;yes\&quot; />\n      <span>Yes</span>\n    </label>\n  </div>\n  <div class=\&quot;radio\&quot;>\n    <label>\n      <input type=\&quot;radio\&quot; name=\&quot;exclude-from-nav\&quot; value=\&quot;no\&quot; />\n      <span>No</span>\n    </label>\n  </div>\n\n  <% if (data.languages) { %>\n    <label>Language</label>\n    <select class=\&quot;form-control\&quot; name=\&quot;language\&quot;>\n      <% _.each(data.languages, function (lang) { %>\n        <option value=\&quot;<%= lang.value %>\&quot;><%= lang.title %></option>\n      <% }); %>\n    </select>\n  <% } %>\n\n  <div class=\&quot;checkbox\&quot;>\n    <label>\n      <input type=\&quot;checkbox\&quot; name=\&quot;recurse\&quot; value=\&quot;yes\&quot; />\n      <span>Include contained items</span>\n    </label>\n    <p class=\&quot;help-block\&quot;>If checked, this will attempt to modify the status of all content in any selected folders and their subfolders.</p>\n  </div>\n\n</div>\n&quot;, &quot;dataUrl&quot;: &quot;http://localhost:8080/Plone2/@@fc-properties&quot;}}], &quot;rearrange&quot;: {&quot;properties&quot;: {&quot;created&quot;: &quot;Created on&quot;, &quot;Creator&quot;: &quot;Creator&quot;, &quot;effective&quot;: &quot;Publication date&quot;, &quot;end&quot;: &quot;End Date&quot;, &quot;expires&quot;: &quot;Expiration date&quot;, &quot;id&quot;: &quot;ID&quot;, &quot;is_folderish&quot;: &quot;Folder&quot;, &quot;modified&quot;: &quot;Last modified&quot;, &quot;review_state&quot;: &quot;Review state&quot;, &quot;sortable_title&quot;: &quot;Title&quot;, &quot;start&quot;: &quot;Start Date&quot;, &quot;Subject&quot;: &quot;Tags&quot;, &quot;total_comments&quot;: &quot;Total comments&quot;, &quot;Type&quot;: &quot;Type&quot;, &quot;UID&quot;: &quot;UID&quot;, &quot;getObjPositionInParent&quot;: &quot;getObjPositionInParent&quot;, &quot;is_default_page&quot;: &quot;is_default_page&quot;, &quot;exclude_from_nav&quot;: &quot;exclude_from_nav&quot;, &quot;path&quot;: &quot;path&quot;}, &quot;url&quot;: &quot;http://localhost:8080/Plone2{path}/@@fc-rearrange&quot;}, &quot;basePath&quot;: &quot;/&quot;, &quot;upload&quot;: {&quot;relativePath&quot;: &quot;@@fileUpload&quot;, &quot;baseUrl&quot;: &quot;http://localhost:8080/Plone2&quot;, &quot;initialFolder&quot;: &quot;4310134d355d453c88e2931721099d82&quot;, &quot;useTus&quot;: false}, &quot;thumb_scale&quot;: &quot;tile&quot;}"></div>
    

              </div>

It goes wrong on Jenkins as well. For example the "Select All items" says:

Condition 'return !!document.querySelector('.pat-structure div.navbar')' did not become true in 30 seconds.

I can usually find a working link to the report, including screen shots, but apparently not today...

It also goes wrong in my experimental GitHub Action. If you go to the summary and scroll down, you will find as an artifact a zip of parts/test where you can see all passed and failed robot tests, including screen shots for the failed ones.

Please help make Jenkins green again!

(For the curious among you: the point of my experimental GitHub Action is to see if moving the robot tests to GHA helps: then the tests run in a box, without interference from other jobs.)

@mauritsvanrees
Copy link
Member Author

The module federation in plone.staticresources was merged. Trying it manually, I no longer see a problem in the folder contents. Robot tests still randomly fail though.

@petschki
Copy link
Member

petschki commented Jun 1, 2022

I think this is because of the parallel running robot tests you've mentioned in #3540 ... I was lucky and ran 6.0py3.7 Robot Framework and 6.0py3.9 Robot Framework alone and they're green right now (2022-06-01T16:26) ... let's see what 6.0py3.8 says ...

@mauritsvanrees
Copy link
Member Author

The folder contents robot tests seem fine now.
The tests that I think most often fail now, are:

  • Test Querystring, with a failure like Element 'jquery=.select2-drop-active[style*="display: block;"] input' not visible after 30 seconds.
  • Test Fields, e.g. Text 'New style Article' did not appear in 30 seconds.
  • Test Controlpanel Filter, e.g. Page should have contained text 'heading' but did not.

I don't know if this means some javascript needs to become more stable, perhaps against race conditions, or if the tests need to be made more stable.

On gh-actions, where there are no parallel running processes, I also see querystring failures, and filter controlpanel failures.
There is also an occasional plone.app.event error TypeError: can't subtract offset-naive and offset-aware datetimes, although it could be that a robot test triggers this to check if the javascript can handle such an error, I don't know.

@petschki
Copy link
Member

petschki commented Jun 6, 2022

I am able to reproduce the failing robottests: when I edit for example the test_querystring.robot and let it run it fails. The second time it succeeds. After editing again it fails again. Don't know if this is only a local behavior but I've started #3552 to investigate some bits which I think have to do mainly with select2 selectors.

@fredvd
Copy link
Member

fredvd commented Jun 7, 2022

Also left on the Discord:

I pushed one commit to the robottest-fix branch to add 2 extra visible/move to focus commands around the querystring index type selection. Had 2 random breaks on that locally before changing it, now I can no longer reproduce it locally with 3 runs... 5 runs

I think it's a viewport issue when the select2 dropdowns from the querystring widget go just below the viewport with some of their options, mainly on the index selection. I did the same for a linkintegrity test issue I saw this morning where the modal that shows which links break also expands below the height of the visible area. Similar move into focus checks were added to the control panel tests after the bootstrap 5 updates because the Ok/Save buttons on control panel forms became unreachable semi-randomly.

@mauritsvanrees
Copy link
Member Author

This seems okay now. Robot tests are fairly stable now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants