Skip to content

Conversation

@rileyajones
Copy link
Contributor

Motivation for features / changes

Somehow some tests got broken on master and caused nightly to fail
https://github.com/tensorflow/tensorboard/actions/runs/5377348327/jobs/9755711856#step:11:2529

@rileyajones rileyajones requested a review from arcra June 27, 2023 00:05
@rileyajones rileyajones marked this pull request as ready for review June 27, 2023 00:05
dispatchedActions.push(action);
});
store.overrideSelector(getSideBarWidthInPercent, 10);
store.overrideSelector(getRunsTableFullScreen, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it obvious why this is necessary/desired? Is this a workaround to the issue we had, or doing something properly that wasn't done properly before?

Either way, would a comment help?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different failure that seems to only happen occasionally (I'm not sure why it doesn't always happen). While the primary issue relates back to #6442 this issue is more recent and relates back to #6451.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me what this issue is, and the PR only says "fixes broken test".

I don't think that anybody else reading this line of code would understand why it's needed and know that it should not be removed.

Could you please update the PR description with what the issue(s) being fixed is (are), and add a comment in this line describing why it's useful/necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I looked at this line of code and understood what was happening. I don't think a comment is necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The state is initialized with this value already set to False, in this line: http://github.com/tensorflow/tensorboard/blob/master/tensorboard/webapp/core/testing/index.ts#L75

So my point was that while it's clear what the line does, it's not clear why it's needed. Someone reading these tests might think "this is the default value, this line shouldn't be necessary", and attempt to remove it, possibly resulting in flaky tests again.

I would have expected a comment like:
// This is the default when we initialize the state, so this line shouldn't be needed, but
// for some reason some tests seem to be using a state that is not the initial state (maybe link to issue).

Not a big deal, but that was my point. I'm sorry I didn't communicate my intention/expectation clearly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, now that you expand on it, you're right, it doesn't make a great deal of sense. When I said I "understood what was happening" I was thinking back to the not-too-distant past where we were creating empty mock stores (instead of calls to provideMockTbStore()) and we had to override every single selector used by the component being tested.

I also agree the current comment doesn't explain the situation sufficiently.

@rileyajones rileyajones requested a review from arcra June 27, 2023 00:20
dispatchedActions.push(action);
});
store.overrideSelector(getSideBarWidthInPercent, 10);
store.overrideSelector(getRunsTableFullScreen, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me what this issue is, and the PR only says "fixes broken test".

I don't think that anybody else reading this line of code would understand why it's needed and know that it should not be removed.

Could you please update the PR description with what the issue(s) being fixed is (are), and add a comment in this line describing why it's useful/necessary?

@rileyajones rileyajones merged commit 5534f1e into tensorflow:master Jun 27, 2023

getRunIds() {
return this.data.map((row) => row.id);
return (this.data || []).map((row) => row.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also find this a bit difficult to understand. this.data is a required property typed as TableData[] so the || [] part of this.data || [] should never be evaluated in practice.

Are you adding this just because of some deficiency in the test? If so, it would be better to fix the test.

dispatchedActions.push(action);
});
store.overrideSelector(getSideBarWidthInPercent, 10);
store.overrideSelector(getRunsTableFullScreen, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, now that you expand on it, you're right, it doesn't make a great deal of sense. When I said I "understood what was happening" I was thinking back to the not-too-distant past where we were creating empty mock stores (instead of calls to provideMockTbStore()) and we had to override every single selector used by the component being tested.

I also agree the current comment doesn't explain the situation sufficiently.

rileyajones added a commit that referenced this pull request Jun 27, 2023
## Motivation for features / changes
In #6458 I fixed a couple of a tests which should have been failing but
were sporadically passing. In this PR I believe I have fixed the
underlying cause of the flakiness.
Thanks #6266 for pointing the way.

This broke nightly last night

https://github.com/tensorflow/tensorboard/actions/runs/5388986210/jobs/9782358616
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants