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

[Build] Darwin test failed -[MTRXPCListenerSampleTests test900_SubscribeClusterStateCache] #27507

Closed
woody-apple opened this issue Jun 27, 2023 · 3 comments · Fixed by #27826
Closed

Comments

@woody-apple
Copy link
Contributor

Build issue(s)

2023-06-27T05:25:37.9210620Z 2023-06-27 05:25:37.918 xcodebuild[85838:204236] [MT] IDETestOperationsObserverDebug: 151.145 sec, +151.145 sec -- end
2023-06-27T05:25:43.5069200Z Failing tests:
2023-06-27T05:25:43.5069390Z 
2023-06-27T05:25:43.5070160Z 	-[MTRXPCListenerSampleTests test900_SubscribeClusterStateCache]
2023-06-27T05:25:43.5070520Z Test session results, code coverage, and logs:
2023-06-27T05:25:43.5070700Z 
2023-06-27T05:25:43.5078630Z ** TEST FAILED **
2023-06-27T05:25:43.5078830Z 
2023-06-27T05:25:43.5080000Z 	/Users/runner/Library/Developer/Xcode/DerivedData/Matter-fezxjrcgbvmiwkgpcrhtmcinmudo/Logs/Test/Test-Matter Framework Tests-2023.06.27_05-13-40-+0000.xcresult
2023-06-27T05:25:43.5080670Z 
2023-06-27T05:25:43.5139080Z Testing started
2023-06-27T05:25:48.5399760Z ##[error]Process completed with exit code 65.

https://github.com/project-chip/connectedhomeip/actions/runs/5385718043/jobs/9775015395

Platform

No response

Anything else?

No response

@bzbarsky-apple
Copy link
Contributor

Failing bit:

2023-06-27T05:25:19.1145580Z /Users/runner/work/connectedhomeip/connectedhomeip/src/darwin/Framework/CHIPTests/MTRXPCListenerSampleTests.m:1793: error: -[MTRXPCListenerSampleTests test900_SubscribeClusterStateCache] : (([result[@"data"][@"value"] boolValue]) equal to (YES)) failed: ("NO") is not equal to ("YES")
2023-06-27T05:25:19.1249260Z Test Case '-[MTRXPCListenerSampleTests test900_SubscribeClusterStateCache]' failed (9.273 seconds).

This looks like a racy test to me. It sends an "on" command and then once we get the response to that command it fulfills the expectation we are waiting on. Once that happens we try to read the cached data. In this case you can see in the log that this read is happening interleaved with (on a different thread) us getting the actual data report that would update said cached data.

This is actually quite easy to reproduce if I change the min-interval for the subscription to 10.

@bzbarsky-apple
Copy link
Contributor

I guess the test has a sleep(1) to try to make it pass...but that's still racy.

@bzbarsky-apple
Copy link
Contributor

And it looks like the XPC subscribe API does not report attribute bits, so there is no way to wait until we actually get the report.

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Jul 8, 2023
We used a 1s min-interval and a 1s sleep to wait for reports.  Those could race
very easily.  Better to use a sleep longer than the min-interval.

Fixes project-chip#27507
@mergify mergify bot closed this as completed in #27826 Jul 8, 2023
mergify bot pushed a commit that referenced this issue Jul 8, 2023
We used a 1s min-interval and a 1s sleep to wait for reports.  Those could race
very easily.  Better to use a sleep longer than the min-interval.

Fixes #27507
@github-project-automation github-project-automation bot moved this from Todo to Done in [Build] Build Issues Jul 8, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in [Platform] Darwin Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants