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

Flaky test: AxHost_GetIFontDispFromFont_InvokeSimpleStyle_Roundtrips #2002

Closed
RussKie opened this issue Oct 2, 2019 · 2 comments · Fixed by #2736
Closed

Flaky test: AxHost_GetIFontDispFromFont_InvokeSimpleStyle_Roundtrips #2002

RussKie opened this issue Oct 2, 2019 · 2 comments · Fixed by #2736
Labels
test-bug Problem in test source code (most likely)

Comments

@RussKie
Copy link
Member

RussKie commented Oct 2, 2019

  • .NET Core Version: master @ 3750c43

Problem description:

AxHost_GetIFontDispFromFont_InvokeSimpleStyle_Roundtrips test fails locally from cli and VS:

  Message: 
    Assert.Equal() Failure
    Expected: 0
    Actual:   254
  Stack Trace: 
    AxHostTests.AxHost_GetIFontDispFromFont_InvokeSimpleStyle_Roundtrips() line 993

image

disp doesn't appear to be cast-able to Ole32.IFontDisp.

Expected behavior:

The test pass

/cc: @hughbe

@RussKie RussKie added the test-bug Problem in test source code (most likely) label Oct 2, 2019
RussKie added a commit to RussKie/winforms that referenced this issue Oct 2, 2019
@weltkante
Copy link
Contributor

weltkante commented Oct 2, 2019

As noted on #2003, is this test done on STA, being only annotated with a [Fact] attribute? I don't know if OLE ActiveX functions are working correctly outside STA ... considering that the OleInitialize native API initializes the thread to STA I'd expect all OLE functions to require STA ... in this case it might be solved together with #1999 by using the proper test annotations

@weltkante
Copy link
Contributor

weltkante commented Oct 5, 2019

disp doesn't appear to be cast-able to Ole32.IFontDisp

Wasn't able to reproduce this, is it failing consistently? Inconsistently failing casts really hint at the COM runtime being broken. So first thing to try once you have a machine where you can reproduce it is to use [WinFormFact] and place a call of Assert(STA, Application.OleRequired()); at the begin of the test.

If this fixes the problem then this PR will be integrating the OleRequired call into WinFormFact so you don't have to do it manually anymore.

@ghost ghost added the 🚧 work in progress Work that is current in progress label Jan 18, 2020
@ghost ghost removed the 🚧 work in progress Work that is current in progress label Jan 19, 2020
@RussKie RussKie removed this from the Future milestone Jan 19, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
test-bug Problem in test source code (most likely)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants