Skip to content

Commit b0d8cb8

Browse files
committed
[SourceKit] Remove flakey test assertion
Exactly when this happens is still somewhat of a mystery, but given we allow annotations in either response, it doesn't seem worth asserting over. Resolves rdar://139356981.
1 parent 5cc8264 commit b0d8cb8

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tools/SourceKit/tools/sourcekitd-test/sourcekitd-test.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,15 +1616,11 @@ static void getSemanticInfoImpl(sourcekitd_variant_t Info) {
16161616

16171617
static void getSemanticInfoImplAfterDocUpdate(sourcekitd_variant_t EditOrOpen,
16181618
sourcekitd_variant_t DocUpdate) {
1619-
if (sourcekitd_variant_dictionary_get_uid(EditOrOpen, KeyDiagnosticStage) ==
1620-
SemaDiagnosticStage) {
1621-
// FIXME: currently we only return annotations once, so if the original edit
1622-
// or open request was slow enough, it may "take" the annotations. If that
1623-
// is fixed, we can skip checking the diagnostic stage and always use the
1624-
// DocUpdate variant.
1625-
assert(sourcekitd_variant_get_type(sourcekitd_variant_dictionary_get_value(
1626-
DocUpdate, KeyAnnotations)) == SOURCEKITD_VARIANT_TYPE_NULL);
1627-
1619+
// FIXME: currently we only return annotations once, so depending on thread
1620+
// ordering, the open/edit or update may contain them. Really we should
1621+
// switch everything to pull based to remove races like this.
1622+
if (sourcekitd_variant_get_type(sourcekitd_variant_dictionary_get_value(
1623+
DocUpdate, KeyAnnotations)) == SOURCEKITD_VARIANT_TYPE_NULL) {
16281624
getSemanticInfoImpl(EditOrOpen);
16291625
} else {
16301626
getSemanticInfoImpl(DocUpdate);

0 commit comments

Comments
 (0)