OrchardCore icon indicating copy to clipboard operation
OrchardCore copied to clipboard

Flaky Test in RecentBlogPostsQueryTests

Open hishamco opened this issue 7 months ago • 7 comments

https://github.com/OrchardCMS/OrchardCore/actions/runs/15701944683/job/44238626123

hishamco avatar Jun 17 '25 08:06 hishamco

It's not that test alone, others are also failing.

gvkries avatar Jun 17 '25 09:06 gvkries

See from https://github.com/OrchardCMS/OrchardCore/pull/18043#issuecomment-2978490764

Piedone avatar Jun 17 '25 12:06 Piedone

I've debugged this error and it happens because background tasks are updating the index document concurrently to each other and to probably to deferred tasks as well.

@MikeAlhayek Access to the index document must be synchronized somehow.

gvkries avatar Jun 17 '25 13:06 gvkries

E.g. here is the error caused by the two background tasks indexing-initialize and rebuild-indexes running concurrently:

Image

gvkries avatar Jun 17 '25 13:06 gvkries

@gvkries can we revert the affected PR, then we could add it again with extensive testing, because flaky tests are annoying, I spend more than 30 minutes to make my PR pass. Coz I need to re-run the failing tests all the time

hishamco avatar Jun 17 '25 13:06 hishamco

@hishamco I don't think that is an option, the related PR is massive and issues are kind of expected because of that 🤗

gvkries avatar Jun 17 '25 14:06 gvkries

That's why we need to do extensive tests, especially for massive PR That's why @Piedone all the time mentioned tests as an essential thing we need to do, especially for OC 3.0.0

So let's think about a proper solution for the current case, instead of breaking the build for new PRs

hishamco avatar Jun 17 '25 14:06 hishamco

@MikeAlhayek Access to the index document must be synchronized somehow.

This PR will fix that https://github.com/OrchardCMS/OrchardCore/pull/18052

MikeAlhayek avatar Jun 17 '25 20:06 MikeAlhayek

This PR will fix that https://github.com/OrchardCMS/OrchardCore/pull/18052

The build is fail

hishamco avatar Jun 17 '25 21:06 hishamco

The build is fail

Its the test that is failing with a different issue. Same issue as this PR is having.

MikeAlhayek avatar Jun 17 '25 21:06 MikeAlhayek

This is fixed by #18052 and #18054.

gvkries avatar Jun 18 '25 14:06 gvkries