← 输入框|github.com|刷新
Skip to content

Add Reducer capabilities by introducing a Reproducer that can be retrieved from TestOracle - #624

Merged
mrigger merged 9 commits into
sqlancer:masterfrom
kshehata:return_not_throw
Dec 4, 2022
Merged

mrigger merged 9 commits into
sqlancer:masterfrom
kshehata:return_not_throw

Conversation

@kshehata

Copy link
Copy Markdown
Contributor

Quick preview of what I'm working on. This adds the type information to return a Reproducer, but doesn't modify the check() method. Is this heading in the right direction? If so, I can add the Reducer changes tomorrow.

@mrigger

mrigger commented Nov 29, 2022

Copy link
Copy Markdown
Contributor

Looks good, thanks!

@mrigger

mrigger commented Nov 29, 2022 •

Copy link
Copy Markdown
Contributor

Currently, the tests are failing due to the newly-added HSQLDB implementation.

@kshehata

Copy link
Copy Markdown
Contributor Author

Extended this with Reproducer support in SQLite3's NoREC Oracle and the StatementReducer to use it. PTAL and let me know if this looks good so far?

I'm trying to figure out now how to connect the two. The problem I'm facing is that Main has what is needed to make a new GlobalState for the Reducer to use, but ProviderAdapter has the Reproducer. Here are my ideas so far:

  1. Have ProviderAdapter catch the AssertionError and return the reproducer if it exists, or rethrow if it doesn't.
  2. Make another call to ProviderAdapter for reducing the query.
  3. Make ProviderAdapter cache the Reproducer and return it in a separate call. This seems not great because that means the Reproducer is being cached twice.
  4. Have ProviderAdapter clone the GlobalState. Is that possible?

Let me know what you think. I'm less familiar with this part of the design, so I'm not sure what the best choice is.

@mrigger mrigger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not very sure. I think it would be reasonable to implement a copy method in GlobalState. Perhaps some care would be required to ensure that we deep-copy StateToReproduce. The other options also sound reasonable. Perhaps you can go ahead with the method you feel is most appropriate?

Btw, I'm boarding a long-distance flight and there might be some delays with my responses in the next few days. Sorry for that!

}

public void setStatements(List<Query<?>> statements) {
this.statements = statements;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps it might be safer to defensively copy the list?

@kshehata kshehata changed the title Change TestOracle to allow returning a Reproducer Add Reducer capabilities by introducing a Reproducer that can be retrieved from TestOracle Dec 2, 2022
@kshehata

kshehata commented Dec 2, 2022

Copy link
Copy Markdown
Contributor Author

I've updated ProviderAdapter to catch AssertionError so it can pull down the Reproducer and return it to Main. Main then uses similar logic to the previous PR to do the reducing. I've also rebased to master. It's hidden behind a flag and doesn't change any of the actual output logs, just outputs to stdout. Is this now at a good state to merge? I'll squash before merging.

@mrigger mrigger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, LGTM! I will use the GitHub user interface to update the branch and squash the commits.

@mrigger
mrigger enabled auto-merge (squash) December 3, 2022 04:29
@mrigger

mrigger commented Dec 3, 2022

Copy link
Copy Markdown
Contributor

Sorry, it seems that due to the new HSQLDB component, the build currently fails.

auto-merge was automatically disabled December 3, 2022 14:00

Head branch was pushed to by a user without write access

@kshehata

kshehata commented Dec 3, 2022

Copy link
Copy Markdown
Contributor Author

I've fixed HSQLDB and it should pass all tests now. Please go ahead with the squash and merge when possible. Thanks!

@mrigger
mrigger enabled auto-merge (squash) December 3, 2022 17:51
@kshehata

kshehata commented Dec 3, 2022

Copy link
Copy Markdown
Contributor Author

Test seem to be failing as apt-get cannot find Citus ?

Unable to locate package postgresql-13-citus-10.1

@mrigger

mrigger commented Dec 4, 2022

Copy link
Copy Markdown
Contributor

Yes, merging the PR despite the failure.

@halilozanakgul: could you please have a look at the Citus issue?

@mrigger
mrigger disabled auto-merge December 4, 2022 08:36
@mrigger
mrigger merged commit 625204e into sqlancer:master Dec 4, 2022
@kshehata

kshehata commented Dec 4, 2022

Copy link
Copy Markdown
Contributor Author

Fantastic, thanks!

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.

2 participants