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

i#725 attach: Remove flakiness from attach test #6244

Merged
merged 1 commit into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion suite/tests/client-interface/attach_blocking.expect
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
starting
thank you for testing attach
thread init
event_post_attach
done
10 changes: 7 additions & 3 deletions suite/tests/client-interface/attach_test.dll.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* **********************************************************
* Copyright (c) 2021-2022 Google, Inc. All rights reserved.
* Copyright (c) 2021-2023 Google, Inc. All rights reserved.
* Copyright (c) 2008-2010 VMware, Inc. All rights reserved.
* **********************************************************/

Expand Down Expand Up @@ -39,14 +39,17 @@

static thread_id_t injection_tid;
static bool first_thread = true;
static bool saw_attach_event = false;

static void
dr_exit(void)
{
if (!saw_attach_event)
dr_fprintf(STDERR, "Error: never saw attach event!\n");
#ifdef WINDOWS
dr_fprintf(STDERR, "done\n");
#else
/* The app prints 'done' for us. */
/* The app prints 'done' for us. */
ivankyluk marked this conversation as resolved.
Show resolved Hide resolved
#endif
}

Expand Down Expand Up @@ -91,7 +94,8 @@ dr_exception_event(void *drcontext, dr_exception_t *excpt)
static void
event_post_attach(void)
{
dr_fprintf(STDERR, "%s\n", __FUNCTION__);
// We do not print here as the ordering is non-deterministic vs thread init.
saw_attach_event = true;
}

DR_EXPORT
Expand Down
6 changes: 0 additions & 6 deletions suite/tests/client-interface/attach_test.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ starting attachee
starting
#endif
thank you for testing attach
#ifdef WINDOWS
event_post_attach
thread init
#else
thread init
event_post_attach
#endif
#ifdef WINDOWS
MessageBox closed
#endif
Expand Down