Skip to content

Conversation

@tbekas
Copy link
Contributor

@tbekas tbekas commented Aug 14, 2024

This is an optimization only. No functionality is changed, therefore no need to update any tests.

@tbekas tbekas requested review from benbierens, dryajov and gmega August 14, 2024 16:02
benbierens
benbierens previously approved these changes Aug 15, 2024
Copy link
Contributor

@benbierens benbierens left a comment

Choose a reason for hiding this comment

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

👍

except CatchableError as err:
return failure(err)

if maybeCurrentData == maybeNewData:
Copy link
Contributor

@gmega gmega Aug 15, 2024

Choose a reason for hiding this comment

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

🔴 Well technically you should be able to test for this (the absence of a write), and I'd argue you should test for it as otherwise you can't know if your optimization is actually working (which is something we care about, as otherwise there'd be no point in putting it there), no matter how convincing the code looks. 🙂

I'm wiling to let this pass - against my own best judgement - if you tell me that writing such a test is complicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that skipping writes is not such a crucial feature that would justify having a test that verify if something was called or not called (one of the worst kinds of tests imo), but I've added such test anyway.

@tbekas tbekas force-pushed the skip-unnecessary-write branch 3 times, most recently from 9bcef1a to e1046b6 Compare August 28, 2024 14:40
@tbekas tbekas force-pushed the skip-unnecessary-write branch from e1046b6 to c151f93 Compare August 28, 2024 14:50
Copy link
Contributor

@benbierens benbierens left a comment

Choose a reason for hiding this comment

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

I like it

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.

4 participants