2009-08-28 12 views
0

우리는 다음과 같은 오류가 테스트 :ContextSwitchDeadlock는 (통합) 테스트에서 실행할 때

ContextSwitchDeadlock was detected 
Message: The CLR has been unable to transition from COM context 0x344b0c0 to COM 
context 0x344b230 for 60 seconds. The thread that owns the destination context/apartment is 
most likely either doing a non pumping wait or processing a very long running operation 
without pumping Windows messages. This situation generally has a negative performance 
impact and may even lead to the application becoming non responsive or memory usage 
accumulating continually over time. To avoid this problem, all single threaded apartment 
(STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and 
routinely pump messages during long running operations. 

테스트하지 엔티티 프레임 워크를 사용하여 데이터베이스에서 데이터를 가져 오는 서비스 계층의 메소드에 대한 WCF 호출 . 데이터는 EntLib Caching Application Block을 사용하여 서버 측에서 캐시됩니다.

서버 측에서 동일한 코드를 테스트하는 테스트는 오류없이 수행됩니다.

답변

1

발견.

우리는 WCF 프록시를 올바르게 닫지 않았습니다. 우리는 close 또는 abort와 함께 try catch 대신 "using"을 사용하고있었습니다.

따라서 하나의 테스트에서 오류가 발생하면 동일한 WCF 서비스를 사용하려고 시도한 후속 테스트에서 ContextSwitchDeadlock이 발생합니다.

관련 문제