git-machete-intellij-plugin: `skipNonExistentBranches_...` UI test failing: unexpected branch in the refreshed table model, due to autodiscover

That’s something new at least 😆

Build: https://app.circleci.com/pipelines/github/VirtusLab/git-machete-intellij-plugin/5562/workflows/b837b1b9-1e2f-4d5c-8d7f-2e7090729a98/jobs/5867

com.virtuslab.gitmachete.uitest.UITestSuite > skipNonExistentBranches_toggleListingCommits_slideOutRoot FAILED
    java.lang.AssertionError: expected:<List(allow-ownership-link, build-chain, call-ws, develop, hotfix/add-trigger, master, update-icons)> but was:<ArraySeq(allow-ownership-link, build-chain, call-ws, develop, drop-constraint, hotfix/add-trigger, master, update-icons)>
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:118)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at com.virtuslab.gitmachete.uitest.UITestSuite.skipNonExistentBranches_toggleListingCommits_slideOutRoot(UITestSuite.scala:88)

It’s strange… drop-constraint appears in refreshed model. But it’s not added to machete file in the first place, nor later by overwrite.

The only way I see it is that the branch has been automatically rediscovered but that should not take place by refresh, am I right? Or do you see any other options?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (1 by maintainers)

Commits related to this issue

Most upvoted comments

But still - markDirtyAndRefresh takes async param… we must be careful

I am looking around GitMacheteRepositoryUpdateBackgroundable - I am wondering if the next lines

        gitRepository.getMacheteFile().forEach(macheteFile -> VfsUtil.markDirtyAndRefresh(/* async */ true,
            /* recursive */ false, /* reloadChildren */ false, macheteFile));

can be executed before the backgroundable finishes 🤔

I have the other suspect. The logic seems to be good however there is some race condition (I think I found the place but now the tests pass xd).

Another interesting observation - looking quickly into the CI runs it happens that this error occurs only on the first build run 🤣 every time I rerun workflow from CI it passes. It seems that the CI must be triggered by push xd